Sha256: 4fefc032a48238f682c7e3a33dab27deae4234f7b64b3b2bbdc5b2295ecf5082
Contents?: true
Size: 945 Bytes
Versions: 2
Compression:
Stored size: 945 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 # NOTE: CouchPotato is based on ActiveModel. # NOTE: CouchPotato::Persistence must be included before OmniAuth::Identity::Models::CouchPotatoModule 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 def save CouchPotato.database.save(self) end end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
omniauth-identity-3.0.8 | lib/omniauth/identity/models/couch_potato.rb |
omniauth-identity-3.0.7 | lib/omniauth/identity/models/couch_potato.rb |