Sha256: c2302dd9c7ac4d0f27cc6798e75e7e53eabe5adea525a8c47cc1cb9bdc59b845

Contents?: true

Size: 430 Bytes

Versions: 24

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true

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

24 entries across 24 versions & 1 rubygems

Version Path
mongoid-8.1.7 lib/mongoid/timestamps/created/short.rb
mongoid-8.1.6 lib/mongoid/timestamps/created/short.rb
mongoid-8.0.8 lib/mongoid/timestamps/created/short.rb
mongoid-8.1.5 lib/mongoid/timestamps/created/short.rb
mongoid-8.1.4 lib/mongoid/timestamps/created/short.rb
mongoid-8.0.7 lib/mongoid/timestamps/created/short.rb
mongoid-8.1.3 lib/mongoid/timestamps/created/short.rb
mongoid-8.1.2 lib/mongoid/timestamps/created/short.rb
mongoid-8.0.6 lib/mongoid/timestamps/created/short.rb
mongoid-7.5.4 lib/mongoid/timestamps/created/short.rb
mongoid-8.1.1 lib/mongoid/timestamps/created/short.rb
mongoid-8.0.5 lib/mongoid/timestamps/created/short.rb
mongoid-8.1.0 lib/mongoid/timestamps/created/short.rb
mongoid-7.5.3 lib/mongoid/timestamps/created/short.rb
mongoid-8.0.4 lib/mongoid/timestamps/created/short.rb
mongoid-8.0.3 lib/mongoid/timestamps/created/short.rb
mongoid-7.5.2 lib/mongoid/timestamps/created/short.rb
mongoid-8.0.2 lib/mongoid/timestamps/created/short.rb
mongoid-7.5.1 lib/mongoid/timestamps/created/short.rb
mongoid-7.4.3 lib/mongoid/timestamps/created/short.rb