-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Compatibility with Rails 5.2.1 & Ransack #2826
Conversation
This is the issue on ransack that is making our spec fail, let's see what happen. In the meantime ransack 2.0 has been released so I'm going to bump our dependency up in the core gemspec. |
15e097d
to
786f516
Compare
Ransack 2.0.1 is the only version compatible with rails 5.2.1. Rails < 5.0 is no more supported since it needs to use ransack 1.8. This is not an issue since we are not supporting rails < 5.1 anyway.
I'm not sure why but previously the association was returning an instance of ActiveRecord::Associations::CollectionProxy that was considered not changed while reloading. Despite that `shipments` call is still returning the same object, they now have a different `object_id` and this could be the root of the problem. I'm not sure if this issue raised up with Rails 5.2.1 or by using the ransack master branch on github.
786f516
to
ca82f6a
Compare
@kennyadsl see nebulab#15 that might help that last spec failure might be related to a monetize version change. I noticed that latest master build was still Using activerecord 5.1.6 I tried to run the test on that version but it still failed. When I diff my local bundle with the one in circleci a monetize gem bump made me think it could be related. I don't know yet whether it's a problem with the test setup or something wrong with monetize. It seems worth checking though, calculations shouldn't break like that. |
This commit comes from @huoxito work on #15 (Thanks!) On newer versions monetize requires money 6.12 which has a rewrite of the Money#allocate method that we use in DistrubutedAmount calculator. This is the PR that is causing issues: RubyMoney/money#772 This is the issue we need to be solved before relaxing the dependency again: RubyMoney/monetize#118
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.
Thanks!
@@ -35,9 +35,9 @@ Gem::Specification.new do |s| | |||
s.add_dependency 'discard', '~> 1.0' | |||
s.add_dependency 'friendly_id', '~> 5.0' | |||
s.add_dependency 'kaminari-activerecord', '~> 1.1' | |||
s.add_dependency 'monetize', '~> 1.1' | |||
s.add_dependency 'monetize', '~> 1.8.0' |
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.
Minor suggestion would be to add a comment as to why this is locked with a link to the issue that needs to be resolved until it can be relaxed again.
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.
Thanks for the suggestion, I've documented that in the commit message. I prefer not to add comments in the code and if we forgot and keep monetize locked to 1.8 is not that critical. If someone will need to update monetize to 1.9 a git blame
will document the why of this. Does it make sense?
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.
Thanks
ref #2825