SpeciesFileGroup/taxonworks

View on GitHub
app/models/observation/presence_absence.rb

Summary

Maintainability
A
0 mins
Test Coverage

# Present = true; Absent = false (positive negative). Not provided -> no observation was made.
class Observation::PresenceAbsence < Observation
  validates :presence, inclusion: {in:  [true, false]}

  # !! Note that this allows one true, and one false value to be created
  validates_uniqueness_of :descriptor_id, scope: [:presence, :observation_object_id, :observation_object_type], message: 'the observation already exists'

  protected

end