Class: BiologicalRelationshipType
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- BiologicalRelationshipType
- Includes:
- Housekeeping, Shared::IsData
- Defined in:
- app/models/biological_relationship_type.rb
Overview
A biological relationship type a domain or range assertion for a biological Relationship.
Direct Known Subclasses
BiologicalRelationshipObjectType, BiologicalRelationshipSubjectType
Defined Under Namespace
Classes: BiologicalRelationshipObjectType, BiologicalRelationshipSubjectType
Instance Attribute Summary collapse
-
#biological_property_id ⇒ Integer
The property to assign.
-
#biological_relationship_id ⇒ Integer
The relationship to assign it to.
-
#project_id ⇒ Integer
the project ID.
-
#type ⇒ String
Assigns to domain (subject), or range (object).
Instance Method Summary collapse
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 Housekeeping
#has_polymorphic_relationship?
Methods inherited from ApplicationRecord
Instance Attribute Details
#biological_property_id ⇒ Integer
Returns the property to assign.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/biological_relationship_type.rb', line 19 class BiologicalRelationshipType < ApplicationRecord include Housekeeping include Shared::IsData belongs_to :biological_property, inverse_of: :biological_relationship_types belongs_to :biological_relationship, inverse_of: :biological_relationship_types validates_presence_of :type validates :biological_property, presence: true validates :biological_relationship, presence: true def target (self.type =~ /Subject/) ? 'subject' : 'object' end end |
#biological_relationship_id ⇒ Integer
Returns the relationship to assign it to.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/biological_relationship_type.rb', line 19 class BiologicalRelationshipType < ApplicationRecord include Housekeeping include Shared::IsData belongs_to :biological_property, inverse_of: :biological_relationship_types belongs_to :biological_relationship, inverse_of: :biological_relationship_types validates_presence_of :type validates :biological_property, presence: true validates :biological_relationship, presence: true def target (self.type =~ /Subject/) ? 'subject' : 'object' end end |
#project_id ⇒ Integer
the project ID
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/biological_relationship_type.rb', line 19 class BiologicalRelationshipType < ApplicationRecord include Housekeeping include Shared::IsData belongs_to :biological_property, inverse_of: :biological_relationship_types belongs_to :biological_relationship, inverse_of: :biological_relationship_types validates_presence_of :type validates :biological_property, presence: true validates :biological_relationship, presence: true def target (self.type =~ /Subject/) ? 'subject' : 'object' end end |
#type ⇒ String
Returns Assigns to domain (subject), or range (object).
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/biological_relationship_type.rb', line 19 class BiologicalRelationshipType < ApplicationRecord include Housekeeping include Shared::IsData belongs_to :biological_property, inverse_of: :biological_relationship_types belongs_to :biological_relationship, inverse_of: :biological_relationship_types validates_presence_of :type validates :biological_property, presence: true validates :biological_relationship, presence: true def target (self.type =~ /Subject/) ? 'subject' : 'object' end end |
Instance Method Details
#target ⇒ Object
30 31 32 |
# File 'app/models/biological_relationship_type.rb', line 30 def target (self.type =~ /Subject/) ? 'subject' : 'object' end |