Class: OmniAuth::Identity::Models::ActiveRecord
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- OmniAuth::Identity::Models::ActiveRecord
- Includes:
- OmniAuth::Identity::Model, SecurePassword
- Defined in:
- lib/omniauth/identity/models/active_record.rb
Overview
ActiveRecord is based on ActiveModel, so validations are enabled by default.
This is an abstract class; inherit from it to create your user model.
ActiveRecord is an ORM for MySQL, PostgreSQL, and SQLite3: guides.rubyonrails.org/active_record_basics.html
This class provides a base for OmniAuth Identity models using ActiveRecord, including secure password handling and authentication key management.
Constant Summary
Constants included from SecurePassword
SecurePassword::MAX_PASSWORD_LENGTH_ALLOWED
Constants included from OmniAuth::Identity::Model
OmniAuth::Identity::Model::FILTERED_INSPECT_ATTRIBUTES, OmniAuth::Identity::Model::SCHEMA_ATTRIBUTES
Instance Attribute Summary
Attributes included from SecurePassword
Attributes included from OmniAuth::Identity::Model
Class Method Summary collapse
- .auth_key=(key) ⇒ Object
-
.locate(search_hash) ⇒ ActiveRecord::Base?
Finds a record by the given search criteria.
Methods included from SecurePassword
Methods included from OmniAuth::Identity::Model
#auth_key, #auth_key=, #authenticate, included, #info, #uid
Class Method Details
.auth_key=(key) ⇒ Object
55 56 57 58 |
# File 'lib/omniauth/identity/models/active_record.rb', line 55 def auth_key=(key) super validates_uniqueness_of(key, case_sensitive: false) end |
.locate(search_hash) ⇒ ActiveRecord::Base?
Finds a record by the given search criteria.
If the model has a ‘provider’ column, it defaults to ‘identity’.
69 70 71 72 |
# File 'lib/omniauth/identity/models/active_record.rb', line 69 def locate(search_hash) search_hash = search_hash.reverse_merge!("provider" => "identity") if column_names.include?("provider") where(search_hash).first end |