Sha256: 1f01541f9506004eb19eb7a593fa17a4613fd1a82b0130263e7442003034a4e0

Contents?: true

Size: 532 Bytes

Versions: 3

Compression:

Stored size: 532 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"
      super(options)
    end

    def find_by_email(email)
      first(:conditions => { :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

3 entries across 3 versions & 3 rubygems

Version Path
aihs_devise-1.2.rc test/rails_app/app/mongoid/shim.rb
gonow-devise-1.2.rc test/rails_app/app/mongoid/shim.rb
devise-edge-1.2.rc test/rails_app/app/mongoid/shim.rb