Class: ObservationMatrixRow

Inherits:
ApplicationRecord show all
Includes:
Housekeeping, Shared::Citable, Shared::Identifiable, Shared::IsData, Shared::Notable, Shared::Taggable
Defined in:
app/models/observation_matrix_row.rb

Instance Method Summary (collapse)

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods included from ActiverecordUtilities

#trim_attributes

Instance Method Details

- (Object) otu_and_collection_object_blank (private)



30
31
32
33
34
# File 'app/models/observation_matrix_row.rb', line 30

def otu_and_collection_object_blank
  if otu_id.nil? && collection_object_id.nil?
    errors.add(:base, "Specify otu OR collection object!")
  end
end

- (Object) otu_and_collection_object_given (private)



36
37
38
39
40
# File 'app/models/observation_matrix_row.rb', line 36

def otu_and_collection_object_given
  if !otu_id.nil? && !collection_object_id.nil?
    errors.add(:base, "Specify otu OR collection object, not both!")
  end
end

- (Object) set_reference_count



24
25
26
# File 'app/models/observation_matrix_row.rb', line 24

def set_reference_count
  self.reference_count ||= 0
end