Module: MongoMapper::Plugins::Timestamps::ClassMethods

Defined in:
lib/mongo_mapper/plugins/timestamps.rb

Instance Method Summary collapse

Instance Method Details

#timestamps!Object



13
14
15
16
17
# File 'lib/mongo_mapper/plugins/timestamps.rb', line 13

def timestamps!
  key :created_at, Time
  key :updated_at, Time
  class_eval { before_save :update_timestamps }
end