Sha256: 779630ef765337e9820a98a58b481eb2ce54256cd6e34c57b35dc214860e7ec3

Contents?: true

Size: 521 Bytes

Versions: 13

Compression:

Stored size: 521 Bytes

Contents

module Shim
  extend ::ActiveSupport::Concern

  included do
    include ::Mongoid::Timestamps
    field :created_at, :type => DateTime
  end

  module ClassMethods
    def last(options = {})
      options.delete(:order) if options[:order] == "id"
      where(options).last
    end

    def find_by_email(email)
      find_by(:email => email)
    end
  end

  # overwrite equality (because some devise tests use this for asserting model equality)
  def ==(other)
    other.is_a?(self.class) && _id == other._id
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
devise-2.2.8 test/rails_app/app/mongoid/shim.rb
devise-2.2.7 test/rails_app/app/mongoid/shim.rb
devise-2.2.6 test/rails_app/app/mongoid/shim.rb
devise-2.2.5 test/rails_app/app/mongoid/shim.rb
devise-2.2.4 test/rails_app/app/mongoid/shim.rb
devise-warbler-2.2.3 test/rails_app/app/mongoid/shim.rb
devise-2.2.3 test/rails_app/app/mongoid/shim.rb
devise-2.2.2 test/rails_app/app/mongoid/shim.rb
devise-2.2.1 test/rails_app/app/mongoid/shim.rb
devise-2.2.0 test/rails_app/app/mongoid/shim.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/devise-2.2.0.rc/test/rails_app/app/mongoid/shim.rb
devise-2.2.0.rc test/rails_app/app/mongoid/shim.rb
af-devise-2.1.2 test/rails_app/app/mongoid/shim.rb