Sha256: 592d90b2cc70ee39eca4844fb8915ee09a7c44ef9ec4340ab65d732d2bdae02c

Contents?: true

Size: 746 Bytes

Versions: 1

Compression:

Stored size: 746 Bytes

Contents

# frozen_string_literal: true

require 'nobrainer'

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

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-identity-3.0.9 lib/omniauth/identity/models/nobrainer.rb