Class: Observation::Qualitative

Inherits:
Observation show all
Defined in:
app/models/observation/qualitative.rb

Instance Attribute Summary

Attributes inherited from Observation

#observation_object_global_id

Instance Method Summary (collapse)

Methods inherited from Observation

#convert_observation_object_global_id, copy, human_name, object_scope, #observation_object, #otu_or_collection_object_set, #set_observation_object_id

Methods included from Housekeeping

#has_polymorphic_relationship?

Instance Method Details

- (Object) character_state_is_unique (protected)



10
11
12
13
14
# File 'app/models/observation/qualitative.rb', line 10

def character_state_is_unique
  if Observation::Qualitative.object_scope(observation_object).where(character_state_id: character_state_id, descriptor_id: descriptor_id).any?
    errors.add(:character_state_id, ' is already observed')
  end
end