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

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

Instance Method Summary collapse

Instance Method Details

#timestamps!Object



8
9
10
11
12
# File 'lib/mongo_mapper/plugins/timestamps.rb', line 8

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