-
Notifications
You must be signed in to change notification settings - Fork 530
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
Add dirty tracking of paranoia attributes #375
base: core
Are you sure you want to change the base?
Conversation
Will fix and squash commits to support Rails 5.0.0. |
This is awesome. Thanks @pfeiffer ! |
@pfeiffer whats the status on this? |
Sorry for not updating on this before now. I didn't manage to get the dirty tracking working on Rails 5 since there has been some changes to the dirty tracking internals. The project I need this for isn't on Rails 5 yet, so it's not relevant for me. Feel free to dig in and update make a new PR with Rails 5 support! :) |
@BenMorganIO It seems |
@dgmora I'd love to be able to look at it and maybe we can figure things out from there. |
@BenMorganIO Did you see #416 ? 🙂 |
👀 is this still relevant to someone ? |
This PR adds ActiveModel dirty tracking to the paranoid attributes.
See: #373
This is extremely useful if you have after_commit callbacks that should only run if certain attributes have changed, eg. if
deleted_at
is changed:PR also supports custom attributes (eg.
active
anddestroyed_at
). In that case dirty tracking is enabled for all attributes.