Class: MinimalistAuthentication::Configuration
- Inherits:
-
Object
- Object
- MinimalistAuthentication::Configuration
- Defined in:
- lib/minimalist_authentication/configuration.rb
Instance Attribute Summary collapse
-
#email_prefix ⇒ Object
Email subject prefix for MinimalistAuthenticationMailer messages Defaults to application name.
-
#login_redirect_path ⇒ Object
Where to route users after a successful login.
-
#logout_redirect_path ⇒ Object
Where to route users after logging out.
-
#request_email ⇒ Object
Check for users email at login and request if blank.
-
#session_key ⇒ Object
The session_key used to store the current_user id.
-
#user_model_name ⇒ Object
The application user class name Defaults to ‘::User’.
-
#validate_email ⇒ Object
Toggle all email validations.
-
#validate_email_presence ⇒ Object
Toggle email presence validation.
-
#verify_email ⇒ Object
Vefify users email address at login.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#user_model ⇒ Object
Returns the user_model class Calling constantize on a string makes this work correctly with the spring application preloader gem.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/minimalist_authentication/configuration.rb', line 56 def initialize self.user_model_name = '::User' self.session_key = :user_id self.validate_email = true self.validate_email_presence = true self.request_email = true self.verify_email = true self.login_redirect_path = :root_path self.logout_redirect_path = :new_session_path self.email_prefix = default_email_prefix end |
Instance Attribute Details
#email_prefix ⇒ Object
Email subject prefix for MinimalistAuthenticationMailer messages Defaults to application name
54 55 56 |
# File 'lib/minimalist_authentication/configuration.rb', line 54 def email_prefix @email_prefix end |
#login_redirect_path ⇒ Object
Where to route users after a successful login. Defaults to :root_path
46 47 48 |
# File 'lib/minimalist_authentication/configuration.rb', line 46 def login_redirect_path @login_redirect_path end |
#logout_redirect_path ⇒ Object
Where to route users after logging out. Defaults to :new_session_path
50 51 52 |
# File 'lib/minimalist_authentication/configuration.rb', line 50 def logout_redirect_path @logout_redirect_path end |
#request_email ⇒ Object
Check for users email at login and request if blank. Only useful if using username to login and users might not have an email set. Defaults to true
38 39 40 |
# File 'lib/minimalist_authentication/configuration.rb', line 38 def request_email @request_email end |
#session_key ⇒ Object
The session_key used to store the current_user id. Defaults to :user_id
20 21 22 |
# File 'lib/minimalist_authentication/configuration.rb', line 20 def session_key @session_key end |
#user_model_name ⇒ Object
The application user class name Defaults to ‘::User’
24 25 26 |
# File 'lib/minimalist_authentication/configuration.rb', line 24 def user_model_name @user_model_name end |
#validate_email ⇒ Object
Toggle all email validations. Defaults to true.
28 29 30 |
# File 'lib/minimalist_authentication/configuration.rb', line 28 def validate_email @validate_email end |
#validate_email_presence ⇒ Object
Toggle email presence validation. Defaults to true. Note: validate_email_presence is only checked if validate_email is true.
33 34 35 |
# File 'lib/minimalist_authentication/configuration.rb', line 33 def validate_email_presence @validate_email_presence end |
#verify_email ⇒ Object
Vefify users email address at login. Defaults to true.
42 43 44 |
# File 'lib/minimalist_authentication/configuration.rb', line 42 def verify_email @verify_email end |
Instance Method Details
#user_model ⇒ Object
Returns the user_model class Calling constantize on a string makes this work correctly with the spring application preloader gem.
71 72 73 |
# File 'lib/minimalist_authentication/configuration.rb', line 71 def user_model user_model_name.constantize end |