Module: Mongoid::Timestamps::Created
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
ActiveSupport::Concern
|
|
Defined in: | lib/mongoid/timestamps/created.rb, lib/mongoid/timestamps/created/short.rb |
Overview
This module handles the behavior for setting up document created at timestamp.
Instance Method Summary
-
#set_created_at
Update the created_at field on the
::Mongoid::Document
to the current time.
DSL Calls
included
[ GitHub ]13 14 15 16 17 18
# File 'lib/mongoid/timestamps/created.rb', line 13
included do include Mongoid::Timestamps::Timeless field :created_at, type: Time set_callback :create, :before, :set_created_at end
Instance Method Details
#set_created_at
Update the created_at field on the ::Mongoid::Document
to the current time. This is only called on create.