Sha256: e2dccb97e7d7c10cc6cb27fb81fd6d8afcc194f261c720e90e8a74df5c326550

Contents?: true

Size: 417 Bytes

Versions: 8

Compression:

Stored size: 417 Bytes

Contents

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

      # 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 Updated
          fields.delete("updated_at")
          field :u_at, type: Time, as: :updated_at
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mongoid-3.1.7 lib/mongoid/timestamps/updated/short.rb
mongoid-3.1.6 lib/mongoid/timestamps/updated/short.rb
mongoid-3.1.5 lib/mongoid/timestamps/updated/short.rb
mongoid-3.1.4 lib/mongoid/timestamps/updated/short.rb
mongoid-3.1.3 lib/mongoid/timestamps/updated/short.rb
mongoid-3.1.2 lib/mongoid/timestamps/updated/short.rb
mongoid-3.1.1 lib/mongoid/timestamps/updated/short.rb
mongoid-3.1.0 lib/mongoid/timestamps/updated/short.rb