Class: AuthEng::User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- AuthEng::User
- Defined in:
- app/models/auth_eng/user.rb
Instance Method Summary collapse
-
#attempt_set_password(params) ⇒ Object
new function to set the password without knowing the current password used in our confirmation controller.
-
#has_no_password? ⇒ Boolean
new function to return whether a password has been set.
- #only_if_unconfirmed ⇒ Object
-
#password_required? ⇒ Boolean
Password is required if it is being set, but not for new records.
- #send_on_create_confirmation_instructions ⇒ Object
Instance Method Details
#attempt_set_password(params) ⇒ Object
new function to set the password without knowing the current password used in our confirmation controller.
20 21 22 23 24 25 |
# File 'app/models/auth_eng/user.rb', line 20 def attempt_set_password(params) p = {} p[:password] = params[:password] p[:password_confirmation] = params[:password_confirmation] update_attributes(p) end |
#has_no_password? ⇒ Boolean
new function to return whether a password has been set
28 29 30 |
# File 'app/models/auth_eng/user.rb', line 28 def has_no_password? self.encrypted_password.blank? end |
#only_if_unconfirmed ⇒ Object
15 16 17 |
# File 'app/models/auth_eng/user.rb', line 15 def only_if_unconfirmed pending_any_confirmation {yield} end |
#password_required? ⇒ Boolean
Password is required if it is being set, but not for new records
33 34 35 36 37 38 39 |
# File 'app/models/auth_eng/user.rb', line 33 def password_required? if !persisted? false else !password.nil? || !password_confirmation.nil? end end |
#send_on_create_confirmation_instructions ⇒ Object
41 42 43 |
# File 'app/models/auth_eng/user.rb', line 41 def send_on_create_confirmation_instructions Devise::Mailer.delay.confirmation_instructions(self) end |