Class: User::UpdateDetails
- Inherits:
-
UserPlane::Command
- Object
- Imperator::Command
- UserPlane::Command
- User::UpdateDetails
- Includes:
- ActiveModel::Validations::Callbacks
- Defined in:
- app/models/user/update_details.rb
Defined Under Namespace
Classes: PasswordDetails
Instance Method Summary collapse
- #email ⇒ Object
- #email=(address) ⇒ Object
- #email_identity ⇒ Object
- #email_verification ⇒ Object
-
#failed_password_change? ⇒ Boolean
Returns ture if a new password was set, but the change was rejected.
- #password_details ⇒ Object
-
#persisted? ⇒ Boolean
Ensures that polymorphic_url treats this as a singular resource.
-
#to_param ⇒ Object
Ensures that polymorphic_url treats this as a singular resource.
Methods inherited from UserPlane::Command
#perform, #perform!, #perform_validations
Instance Method Details
#email ⇒ Object
61 62 63 |
# File 'app/models/user/update_details.rb', line 61 def email email_identity && email_identity.address end |
#email=(address) ⇒ Object
65 66 67 68 69 70 71 72 73 |
# File 'app/models/user/update_details.rb', line 65 def email= address unless address == email if email_identity.new_record? email_identity.address = address else email_identity.unverified_address = address end end end |
#email_identity ⇒ Object
84 85 86 |
# File 'app/models/user/update_details.rb', line 84 def email_identity @account.email || @account.build_email end |
#email_verification ⇒ Object
75 76 77 |
# File 'app/models/user/update_details.rb', line 75 def email_verification email_identity.address_change_verification if email_identity.unverified_address_changed? end |
#failed_password_change? ⇒ Boolean
Returns ture if a new password was set, but the change was rejected.
80 81 82 |
# File 'app/models/user/update_details.rb', line 80 def failed_password_change? password_details.changed? && !email_identity.password_digest_changed? ? true : false end |
#password_details ⇒ Object
88 89 90 |
# File 'app/models/user/update_details.rb', line 88 def password_details @password_details ||= PasswordDetails.new() end |
#persisted? ⇒ Boolean
Ensures that polymorphic_url treats this as a singular resource
47 48 49 |
# File 'app/models/user/update_details.rb', line 47 def persisted? true end |
#to_param ⇒ Object
Ensures that polymorphic_url treats this as a singular resource
53 54 55 |
# File 'app/models/user/update_details.rb', line 53 def to_param nil end |