Module: Mongoid::Timestamps::CreatedAt
- Defined in:
- lib/mongoid/created_at.rb
Instance Method Summary collapse
-
#created_at ⇒ Date
Returns the creation time calculated from ObjectID.
Instance Method Details
#created_at ⇒ Date
Returns the creation time calculated from ObjectID
7 8 9 |
# File 'lib/mongoid/created_at.rb', line 7 def created_at read_attribute(:created_at) || id.generation_time.to_datetime end |