Sha256: eb1c42775842804759da48734d78267026217b86767469d789295d95f60cdc0e

Contents?: true

Size: 701 Bytes

Versions: 3

Compression:

Stored size: 701 Bytes

Contents

# frozen_string_literal: true

require 'couch_potato'

module OmniAuth
  module Identity
    module Models
      # can not be named CouchPotato since there is a class with that name
      module CouchPotatoModule
        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 & 1 rubygems

Version Path
omniauth-identity-3.0.4 lib/omniauth/identity/models/couch_potato.rb
omniauth-identity-3.0.3 lib/omniauth/identity/models/couch_potato.rb
omniauth-identity-3.0.2 lib/omniauth/identity/models/couch_potato.rb