Module: Mince::DataModel::Timestamps::ClassMethods

Defined in:
lib/mince/data_model/timestamps.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#add_timestamps_to_hash(hash) ⇒ Object



39
40
41
42
# File 'lib/mince/data_model/timestamps.rb', line 39

def add_timestamps_to_hash(hash)
  now = Time.now.utc
  hash.merge!(created_at: now, updated_at: now)
end

#set_update_timestamp_for(data_collection, id) ⇒ Object



44
45
46
# File 'lib/mince/data_model/timestamps.rb', line 44

def set_update_timestamp_for(data_collection, id)
  interface.update_field_with_value(data_collection, id, :updated_at, Time.now.utc)
end