Class: InternalAttribute

Inherits:
DataAttribute show all
Defined in:
app/models/internal_attribute.rb

Instance Attribute Summary (collapse)

Attributes inherited from DataAttribute

#attribute_subject_id, #attribute_subject_type, #project_id, #type, #value

Method Summary

Methods inherited from DataAttribute

#editable?, find_for_autocomplete, #predicate_name

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods included from ActiverecordUtilities

#trim_attributes

Instance Attribute Details

- (id) controlled_vocabulary_term_id

The the id of the ControlledVocabularyTerm::Predicate. Term is referenced as #predicate.

Returns:

  • (id)


10
11
12
13
14
15
16
# File 'app/models/internal_attribute.rb', line 10

class InternalAttribute < DataAttribute 
  belongs_to :predicate, foreign_key: 'controlled_vocabulary_term_id', inverse_of: :internal_attributes, class_name: 'Predicate'

  validates_presence_of :controlled_vocabulary_term_id
  validates_uniqueness_of :value, scope: [:attribute_subject_id, :attribute_subject_type, :type, :controlled_vocabulary_term_id]

end