Module: Devise::Models::Compatibility::MongoidPatch
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/devise-security/models/compatibility/mongoid_patch.rb
Instance Method Summary collapse
-
#update_attribute_without_validatons_or_callbacks(name, value) ⇒ Object
Updates the document with the value and does not trigger validations or callbacks.
-
#will_save_change_to_email? ⇒ Boolean
Will saving this record change the
email
attribute?. -
#will_save_change_to_encrypted_password? ⇒ Boolean
Will saving this record change the
encrypted_password
attribute?.
Instance Method Details
#update_attribute_without_validatons_or_callbacks(name, value) ⇒ Object
Updates the document with the value and does not trigger validations or callbacks
25 26 27 |
# File 'lib/devise-security/models/compatibility/mongoid_patch.rb', line 25 def update_attribute_without_validatons_or_callbacks(name, value) set(Hash[*[name, value]]) end |
#will_save_change_to_email? ⇒ Boolean
Will saving this record change the email
attribute?
12 13 14 |
# File 'lib/devise-security/models/compatibility/mongoid_patch.rb', line 12 def will_save_change_to_email? changed.include? 'email' end |
#will_save_change_to_encrypted_password? ⇒ Boolean
Will saving this record change the encrypted_password
attribute?
18 19 20 |
# File 'lib/devise-security/models/compatibility/mongoid_patch.rb', line 18 def will_save_change_to_encrypted_password? changed.include? 'encrypted_password' end |