-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Support Rails 5.2 #256
Support Rails 5.2 #256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will test this to see if it addresses everything. Walking through the PR seems like they are still supporting the ivar structure of Dirty API so this will probably be fine until they decide to drastically change that.
@@ -5,7 +5,7 @@ module Dirty | |||
|
|||
module ClassMethods | |||
def from_database(*) | |||
super.tap { |d| d.changed_attributes.clear } | |||
super.tap { |d| d.send(:clear_changes_information) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need to have it handle both versions since older versions of rails I don't think will support this so maybe:
d.respond_to?(:clear_changes_information) ? d.clear_changes_information : d.changed_attributes.clear
And similar to below to handle both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richardhsu fixed
@richardhsu I would consider independent implementation of changes tracking. Depending on Rails internals makes me sad. |
@andrykonchin Yeah makes sense, and yeah their internals are changing so much now. I've run a few tests with this update and looking good so far. Going to run full suite tomorrow and make sure those pass. |
I'm running this in production, so far no issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@pboling I would like to release new version 2.1.1 with this bug fix only. Does it make sense? |
@andrykonchin do it! |
As for depending on Rails internals, I think making this gem a standalone ORM that can be used with other frameworks would be great. Might as well make that a target goal of a future release. |
This was a tough one to diagnose. The Dirty module introduced the usage of an attribute mutation tracker, being disabled here for functional tests to start working again. This commit is based on: Dynamoid/dynamoid#256 Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <[email protected]>
Related issue #254