Module: Sinatra::Security::LoginField
- Defined in:
- lib/sinatra/security/login_field.rb
Overview
This module allows you to customize the name of the login field used in your datastore. By default :email is used.
Class Method Summary collapse
-
.attr_name(attr_name = nil) ⇒ Symbol
The current attr_name.
- .included(user) ⇒ Object
Class Method Details
.attr_name ⇒ Symbol .attr_name(attr_name) ⇒ Symbol
Returns the current attr_name.
37 38 39 40 |
# File 'lib/sinatra/security/login_field.rb', line 37 def self.attr_name(attr_name = nil) @attr_name = attr_name.to_sym if attr_name @attr_name end |
.included(user) ⇒ Object
43 44 45 46 |
# File 'lib/sinatra/security/login_field.rb', line 43 def self.included(user) user.attribute LoginField.attr_name user.index LoginField.attr_name end |