Sha256: 1433a7b5d5c71652ea68a39c169d82e2787c1d98776379ae85e5671b0567daee

Contents?: true

Size: 480 Bytes

Versions: 9

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

module Shim
  extend ::ActiveSupport::Concern

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

  class_methods do
    def order(attribute)
      asc(attribute)
    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

9 entries across 9 versions & 1 rubygems

Version Path
devise-security-0.18.0 test/dummy/app/mongoid/shim.rb
devise-security-0.17.0 test/dummy/app/mongoid/shim.rb
devise-security-0.16.0 test/dummy/app/mongoid/shim.rb
devise-security-0.15.0 test/dummy/app/mongoid/shim.rb
devise-security-0.14.3 test/dummy/app/mongoid/shim.rb
devise-security-0.14.2 test/dummy/app/mongoid/shim.rb
devise-security-0.14.1 test/dummy/app/mongoid/shim.rb
devise-security-0.14.0 test/dummy/app/mongoid/shim.rb
devise-security-0.14.0.rc1 test/dummy/app/mongoid/shim.rb