Module: OmniAuth::Identity::Models::MongoMapper

Defined in:
lib/omniauth/identity/models/mongo_mapper.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/omniauth/identity/models/mongo_mapper.rb', line 7

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(key)
      where(auth_key => key).first
    end
  end
end