Sha256: 173fa0978df55d122236a22352c2b5b95c73437ffb7e1a64ea8072a4d0a0be91

Contents?: true

Size: 417 Bytes

Versions: 81

Compression:

Stored size: 417 Bytes

Contents

# encoding: utf-8
module Mongoid
  module Timestamps
    module Created

      # Adds a created_at timestamp to the document, but it is stored as c_at
      # with a created_at alias.
      module Short
        extend ActiveSupport::Concern

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

Version data entries

81 entries across 76 versions & 6 rubygems

Version Path
mongoid-7.0.13 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.12 lib/mongoid/timestamps/created/short.rb
mongoid-6.4.8 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.11 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.10 lib/mongoid/timestamps/created/short.rb
mongoid-6.4.7 lib/mongoid/timestamps/created/short.rb
mongoid-6.4.5 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.8 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.7 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.6 lib/mongoid/timestamps/created/short.rb
mongoid-5.4.1 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.5 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.4 lib/mongoid/timestamps/created/short.rb
mongoid-6.4.4 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.3 lib/mongoid/timestamps/created/short.rb
mongoid-6.4.2 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.2 lib/mongoid/timestamps/created/short.rb
mongoid-7.0.1 lib/mongoid/timestamps/created/short.rb
mongoid-6.4.1 lib/mongoid/timestamps/created/short.rb
mongoid-5.4.0 lib/mongoid/timestamps/created/short.rb