-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActiveModel::Dirty support not working #335
Comments
I ran into a similar problem when using Doing so, the This is the respective code in attr_encrypted/lib/attr_encrypted.rb Line 166 in 11df93a
(here for quicker reading:) define_method("#{attribute}=") do |value|
send("#{encrypted_attribute_name}=", encrypt(attribute, value))
instance_variable_set("@#{attribute}", value)
end If I adapt this to closer resemble what Rails' internal define_method("#{attribute}=") do |value|
send("#{encrypted_attribute_name}=", encrypt(attribute, value))
send("[#{attribute}]=", value)
instance_variable_set("@#{attribute}", value)
end This setter implementation would actually assign the attribute. Changes to the attribute will appear in the object's I wasn't sure if this is actually intended by the authors 🤔 |
Any traction on this? |
The attribute_was method does not appear to return the old value from an encrypted value:
This can be seen in the console:
The text was updated successfully, but these errors were encountered: