Class: Specify::Model::Determination

Inherits:
Object
  • Object
show all
Defined in:
lib/specify/models/determination.rb

Overview

A Sequel::Model representing collection objects

Instance Method Summary collapse

Instance Method Details

#before_createObject


24
25
26
27
28
29
30
31
32
# File 'lib/specify/models/determination.rb', line 24

def before_create
  self.Version = 0
  self.TimestampCreated = Time.now
  self.GUID = SecureRandom.uuid
  self.collection = collection_object&.collection
  self.preferred_taxon = taxon.accepted_name || taxon
  self.IsCurrent = 1
  super
end

#before_updateObject


34
35
36
37
38
# File 'lib/specify/models/determination.rb', line 34

def before_update
  self.Version += 1
  self.TimestampModified = Time.now
  super
end