Class: BackOffice::Password
- Inherits:
-
Object
- Object
- BackOffice::Password
- Includes:
- ActiveModel::Model
- Defined in:
- lib/back_office/password.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#plaintext ⇒ Object
Returns the value of attribute plaintext.
-
#plaintext_confirmation ⇒ Object
Returns the value of attribute plaintext_confirmation.
Instance Method Summary collapse
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
5 6 7 |
# File 'lib/back_office/password.rb', line 5 def email @email end |
#plaintext ⇒ Object
Returns the value of attribute plaintext.
5 6 7 |
# File 'lib/back_office/password.rb', line 5 def plaintext @plaintext end |
#plaintext_confirmation ⇒ Object
Returns the value of attribute plaintext_confirmation.
5 6 7 |
# File 'lib/back_office/password.rb', line 5 def plaintext_confirmation @plaintext_confirmation end |
Instance Method Details
#update(attrs) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/back_office/password.rb', line 9 def update(attrs) self.plaintext = attrs[:plaintext] self.plaintext_confirmation = attrs[:plaintext_confirmation] if valid?(:update) user.update(password: plaintext) true end end |
#user ⇒ Object
19 20 21 |
# File 'lib/back_office/password.rb', line 19 def user User.find_by(email: email) if email end |