123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Timestamps::Created::Short

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ActiveSupport::Concern
Defined in: lib/mongoid/timestamps/created/short.rb

Overview

Adds a created_at timestamp to the document, but it is stored as c_at with a created_at alias.

DSL Calls

included

[ GitHub ]


13
14
15
16
17
# File 'lib/mongoid/timestamps/created/short.rb', line 13

included do
  include Created
  fields.delete("created_at")
  field :c_at, type: Time, as: :created_at
end