Sha256: e0202bdbea51f5438b3a546564a47909f7fbe71936aec3a06d9912883260670e
Contents?: true
Size: 1.18 KB
Versions: 2
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true require "couch_potato" module OmniAuth module Identity module Models # CouchPotato is an ORM adapter for CouchDB: # https://github.com/langalex/couch_potato # NOTE: CouchPotato is based on ActiveModel. # NOTE: CouchPotato::Persistence must be included before OmniAuth::Identity::Models::CouchPotatoModule # NOTE: Includes "Module" in the name for invalid legacy reasons. Rename only with a major version bump. module CouchPotatoModule def self.included(base) base.class_eval do include(::OmniAuth::Identity::Model) include(::OmniAuth::Identity::SecurePassword) # validations: true (default) incurs a dependency on ActiveModel, but CouchPotato is ActiveModel based. 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_document(self) end end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
omniauth-identity-3.1.1 | lib/omniauth/identity/models/couch_potato.rb |
omniauth-identity-3.1.0 | lib/omniauth/identity/models/couch_potato.rb |