Module: Ripple::Timestamps::ClassMethods
- Defined in:
- lib/ripple/timestamps.rb
Instance Method Summary collapse
-
#timestamps!(options = {}) ⇒ Object
Adds the :created_at and :updated_at timestamp properties to the document.
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 (={}) property :created_at, Time, .merge(:default => proc { Time.now }) property :updated_at, Time, .dup before_save :touch end |