Sha256: 0a00230d37ef71a90ae78c745db731a9766b9e528da9e5510ca159910b87db5c

Contents?: true

Size: 589 Bytes

Versions: 3

Compression:

Stored size: 589 Bytes

Contents

require 'mongoid'

module OmniAuth
  module Identity
    module Models
      module Mongoid

        def self.included(base)

          base.class_eval do

            include ::OmniAuth::Identity::Model
            include ::OmniAuth::Identity::SecurePassword

            has_secure_password

            def self.auth_key=(key)
              super
              validates_uniqueness_of key, :case_sensitive => false
            end

            def self.locate(search_hash)
              where(search_hash).first
            end

          end

        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
omniauth-identity-2.0.0 lib/omniauth/identity/models/mongoid.rb
omniauth-identity2-2.0 lib/omniauth/identity/models/mongoid.rb
omniauth-identity-1.1.1 lib/omniauth/identity/models/mongoid.rb