Class: ActiveModel::Password
- Inherits:
-
Object
- Object
- ActiveModel::Password
- Includes:
- Model
- Defined in:
- lib/active_model/password.rb,
lib/active_model/password/version.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/active_model/password.rb', line 8 def password @password end |
#user ⇒ Object
Returns the value of attribute user.
8 9 10 |
# File 'lib/active_model/password.rb', line 8 def user @user end |
Instance Method Details
#persisted? ⇒ Boolean
13 14 15 |
# File 'lib/active_model/password.rb', line 13 def persisted? user.present? and user.persisted? end |
#save ⇒ Object
17 18 19 20 21 22 |
# File 'lib/active_model/password.rb', line 17 def save return false unless valid? user.password = password user.password_confirmation = password_confirmation user.save end |