Sha256: 8ad76b15450716659fa5b657cc361d37ad64212a4c4ff6ab86364b2769fda230

Contents?: true

Size: 714 Bytes

Versions: 4

Compression:

Stored size: 714 Bytes

Contents

# frozen_string_literal: true

require 'nobrainer'

module OmniAuth
  module Identity
    module Models
      # http://nobrainer.io/ an ORM for RethinkDB
      # NOTE: NoBrainer is based on ActiveModel.
      module NoBrainer
        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

4 entries across 4 versions & 1 rubygems

Version Path
omniauth-identity-3.0.8 lib/omniauth/identity/models/nobrainer.rb
omniauth-identity-3.0.7 lib/omniauth/identity/models/nobrainer.rb
omniauth-identity-3.0.6 lib/omniauth/identity/models/no_brainer.rb
omniauth-identity-3.0.5 lib/omniauth/identity/models/no_brainer.rb