Class: User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- User
- Includes:
- BCrypt
- Defined in:
- lib/ecrire/app/models/user.rb
Instance Attribute Summary collapse
-
#password_confirmation ⇒ Object
Returns the value of attribute password_confirmation.
Instance Method Summary collapse
Instance Attribute Details
#password_confirmation ⇒ Object
Returns the value of attribute password_confirmation.
6 7 8 |
# File 'lib/ecrire/app/models/user.rb', line 6 def password_confirmation @password_confirmation end |
Instance Method Details
#password ⇒ Object
16 17 18 19 |
# File 'lib/ecrire/app/models/user.rb', line 16 def password return if self.encrypted_password.blank? @password ||= Password.new(self.encrypted_password) end |
#password=(new_password) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/ecrire/app/models/user.rb', line 21 def password=(new_password) if new_password.nil? self.encrypted_password = nil elsif new_password.present? @password = Password.create(new_password) self.encrypted_password = @password end end |