Module: Humanoid::Timestamps::InstanceMethods

Defined in:
lib/humanoid/timestamps.rb

Instance Method Summary collapse

Instance Method Details

#set_created_atObject

Update the created_at field on the Document to the current time. This is only called on create.



18
19
20
# File 'lib/humanoid/timestamps.rb', line 18

def set_created_at
  self.created_at = Time.now.utc if !created_at
end

#set_updated_atObject

Update the updated_at field on the Document to the current time. This is only called on create and on save.



24
25
26
# File 'lib/humanoid/timestamps.rb', line 24

def set_updated_at
  self.updated_at = Time.now.utc
end