-
Notifications
You must be signed in to change notification settings - Fork 53
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
Vault attribute changes are no longer detected in Rails 5.2 #85
Comments
I managed to make it work with The vault attribute is correctly identified as changed but the actual change was not returned ( |
#67 makes more sense to me since it is registering the vault attribute against the attributes API and uses the new changed methods created for |
I'm going to close this issue as those PRs have been merged and this issue should be fixed. Please let us know if this is not the case. |
With the changes made to
ActiveRecord::Dirty
5.2 API,changed
no longer returns the model changes onafter_save
callbacks. More info here: https://www.ombulabs.com/blog/rails/upgrades/active-record-5-1-api-changes.htmlThe proposed solution is to use
saved_changes.keys
insteadchanged
but it seems that that won't work for virtual attributes. The only way I got it working was to usesaved_change_to_attribute?
.If someone else wants to give their opinion on this that would be great, I'm willing to do the PR to fix this issue but would like for someone to confirm if this is the best solution.
The text was updated successfully, but these errors were encountered: