Module: Devise::Models::Compatibility::ActiveRecordPatch
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/devise-security/models/compatibility/active_record_patch.rb
Instance Method Summary collapse
-
#encrypted_password_before_last_save ⇒ String?
The encrypted password that existed before the record was saved.
-
#saved_change_to_encrypted_password? ⇒ Boolean
When the record was saved, was the
encrypted_password
changed?. -
#update_attribute_without_validatons_or_callbacks(name, value) ⇒ Object
Updates the record with the value and does not trigger validations or callbacks.
-
#will_save_change_to_encrypted_password? ⇒ Boolean
When the record is saved, will the
encrypted_password
be changed?.
Instance Method Details
#encrypted_password_before_last_save ⇒ String?
The encrypted password that existed before the record was saved
19 20 21 |
# File 'lib/devise-security/models/compatibility/active_record_patch.rb', line 19 def encrypted_password_before_last_save previous_changes['encrypted_password'].try(:first) end |
#saved_change_to_encrypted_password? ⇒ Boolean
When the record was saved, was the encrypted_password
changed?
12 13 14 |
# File 'lib/devise-security/models/compatibility/active_record_patch.rb', line 12 def saved_change_to_encrypted_password? encrypted_password_changed? end |
#update_attribute_without_validatons_or_callbacks(name, value) ⇒ Object
Updates the record with the value and does not trigger validations or callbacks
33 34 35 |
# File 'lib/devise-security/models/compatibility/active_record_patch.rb', line 33 def update_attribute_without_validatons_or_callbacks(name, value) update_column(name, value) end |
#will_save_change_to_encrypted_password? ⇒ Boolean
When the record is saved, will the encrypted_password
be changed?
25 26 27 |
# File 'lib/devise-security/models/compatibility/active_record_patch.rb', line 25 def will_save_change_to_encrypted_password? changed_attributes['encrypted_password'].present? end |