Module: Clearance::Model::ProtectedInstanceMethods
- Defined in:
- lib/clearance/model.rb
Instance Method Summary collapse
Instance Method Details
#encrypt_password ⇒ Object
73 74 75 76 |
# File 'lib/clearance/model.rb', line 73 def encrypt_password return if password.blank? self.crypted_password = encrypt(password) end |
#initialize_salt ⇒ Object
69 70 71 |
# File 'lib/clearance/model.rb', line 69 def initialize_salt self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{email}--") if new_record? end |
#password_required? ⇒ Boolean
78 79 80 |
# File 'lib/clearance/model.rb', line 78 def password_required? crypted_password.blank? || !password.blank? end |