Module: Clearance::App::Models::User::ProtectedInstanceMethods
- Defined in:
- lib/clearance/app/models/user.rb
Instance Method Summary collapse
Instance Method Details
#encrypt_password ⇒ Object
113 114 115 116 |
# File 'lib/clearance/app/models/user.rb', line 113 def encrypt_password return if password.blank? self.crypted_password = encrypt(password) end |
#initialize_salt ⇒ Object
109 110 111 |
# File 'lib/clearance/app/models/user.rb', line 109 def initialize_salt self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{email}--") if new_record? end |
#password_required? ⇒ Boolean
118 119 120 |
# File 'lib/clearance/app/models/user.rb', line 118 def password_required? normal_user? && (crypted_password.blank? || !password.blank? || !password_confirmation.blank?) end |