Module: Mongoid::Timestamps::Created
- Extended by:
- ActiveSupport::Concern
- Included in:
- Mongoid::Timestamps
- Defined in:
- lib/mongoid/timestamps/created.rb
Overview
This module handles the behaviour for setting up document created at timestamp.
Instance Method Summary collapse
-
#set_created_at ⇒ Object
Update the created_at field on the Document to the current time.
Instance Method Details
#set_created_at ⇒ Object
Update the created_at field on the Document to the current time. This is only called on create.
19 20 21 |
# File 'lib/mongoid/timestamps/created.rb', line 19 def set_created_at self.created_at = Time.now.utc if !created_at end |