Class: OtuRelationship

Inherits:
ApplicationRecord show all
Includes:
Housekeeping, Shared::Citations, Shared::Confidences, Shared::IsData, Shared::Notes, Shared::Tags
Defined in:
app/models/otu_relationship.rb

Overview

An OtuRelationhip links two OTUs in a euler/rcc5 relationship.

# @!attribute subject_otu_id

@return [integer]
the OTU on the left side of the relationhip

Defined Under Namespace

Classes: Disjoint, Equal, Intersecting, PartiallyOverlapping, ProperPart, ProperPartInverse

Instance Attribute Summary collapse

Method Summary

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::Confidences

#reject_confidences

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::Citations

#cited?, #mark_citations_for_destruction, #nomenclature_date, #origin_citation_source_id, #reject_citations, #requires_citation?, #sources_by_topic_id

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods inherited from ApplicationRecord

transaction_with_retry

Instance Attribute Details

#object_otu_idinteger

the OTU on the right side of the relationhip

Returns:

  • (integer)


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/models/otu_relationship.rb', line 16

class OtuRelationship < ApplicationRecord
  include Housekeeping
  # include SoftValidation
  include Shared::Citations
  # include Shared::Identifiers
  include Shared::Notes
  include Shared::Tags
  #  include Shared::Depictions
  include Shared::Confidences
  # include Shared::OriginRelationship
  # TODO:  the conscensus names for our new things
  # include Shared::Taxonomy
  include Shared::IsData

  belongs_to :subject_otu , class_name: 'Otu', inverse_of: :otu_relationships
  belongs_to :object_otu , class_name: 'Otu', inverse_of: :related_otu_relationships

  validates_presence_of :subject_otu
  validates_presence_of :object_otu

  validates_uniqueness_of :subject_otu_id, scope: [:type, :object_otu_id]


end

#typeString

Returns The rails STI name for the relationship type, e.g. OtuRelationship::Disjoint See also api.checklistbank.org/vocab/taxonconceptreltype, github.com/tdwg/tcs2/blob/9eebd904001baab61476852bda53851317161186/master/tcs.yaml#L207.

Returns:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/models/otu_relationship.rb', line 16

class OtuRelationship < ApplicationRecord
  include Housekeeping
  # include SoftValidation
  include Shared::Citations
  # include Shared::Identifiers
  include Shared::Notes
  include Shared::Tags
  #  include Shared::Depictions
  include Shared::Confidences
  # include Shared::OriginRelationship
  # TODO:  the conscensus names for our new things
  # include Shared::Taxonomy
  include Shared::IsData

  belongs_to :subject_otu , class_name: 'Otu', inverse_of: :otu_relationships
  belongs_to :object_otu , class_name: 'Otu', inverse_of: :related_otu_relationships

  validates_presence_of :subject_otu
  validates_presence_of :object_otu

  validates_uniqueness_of :subject_otu_id, scope: [:type, :object_otu_id]


end