Class: ObservationMatrixColumnItem::Dynamic::Tag

Inherits:
ObservationMatrixColumnItem::Dynamic show all
Defined in:
app/models/observation_matrix_column_item/dynamic/tag.rb

Overview

Adds columns to matrix for descriptors tagged with the Keyword

Constant Summary

Constants inherited from ObservationMatrixColumnItem

ALL_STI_ATTRIBUTES

Instance Attribute Summary

Attributes inherited from ObservationMatrixColumnItem

#controlled_vocabulary_term_id, #descriptor_id, #observation_matrix_id, #position, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ObservationMatrixColumnItem::Dynamic

#is_dynamic?

Methods inherited from ObservationMatrixColumnItem

batch_create, batch_create_from_pinboard, batch_create_from_tags, #cleanup_matrix_columns, #cleanup_single_matrix_column, #column_objects, create_for, create_for_pinboard_items, create_for_tags, #decrement_matrix_column_reference_count, #find_or_build_column, human_name, #increment_matrix_column_reference_count, #is_dynamic?, #other_subclass_attributes_not_set, #update_matrix_columns, #update_single_matrix_column

Methods included from Shared::IsData

#errors_excepting, #full_error_messages_excepting, #identical, #is_community?, #is_destroyable?, #is_editable?, #is_in_use?, #is_in_users_projects?, #metamorphosize, #similar

Methods included from Shared::Tags

#reject_tags, #tag_with, #tagged?, #tagged_with?

Methods included from Shared::Notes

#concatenated_notes_string, #reject_notes

Methods included from Shared::Identifiers

#identified?, #next_by_identifier, #previous_by_identifier, #reject_identifiers

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods inherited from ApplicationRecord

transaction_with_retry

Class Method Details

.subclass_attributesObject



10
11
12
# File 'app/models/observation_matrix_column_item/dynamic/tag.rb', line 10

def self.subclass_attributes
  [:controlled_vocabulary_term_id]
end

Instance Method Details

#descriptorsObject



14
15
16
# File 'app/models/observation_matrix_column_item/dynamic/tag.rb', line 14

def descriptors
  Descriptor.joins(:tags).where(tags: {keyword: controlled_vocabulary_term}).to_a
end