Module: Ripple::Timestamps::ClassMethods

Defined in:
lib/ripple/timestamps.rb

Instance Method Summary collapse

Instance Method Details

#timestamps!(options = {}) ⇒ Object

Adds the :created_at and :updated_at timestamp properties to the document.



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

def timestamps!(options={})
  property :created_at, Time, options.merge(:default => proc { Time.now })
  property :updated_at, Time, options.dup
  before_save :touch
end