-
-
Notifications
You must be signed in to change notification settings - Fork 638
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
Fixes SQL exception from rails 5.2 upgrade #479
Fixes SQL exception from rails 5.2 upgrade #479
Conversation
2edaeea
to
048c516
Compare
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.
Hey @lizzyaustad , thanks for investigating that.
I would like to keep this PR open so that we are ready when Rails 5.2 is out of beta (I don't plan to release a version of cancancan to support Rails 5.2 until is out of beta).
When we are ready I'd prefer to have a activerecord_5_adapter.rb rather than extend the version 4 of it. this part you could already do if you have time. Thanks, nice job!
5.2.0.rc1 is out if that counts 😉 |
435ef86
to
c80a563
Compare
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.
Nice! Thanks
5.2.0.rc2 is now out. Is there anything blocking this from getting merged? |
@lizzyaustad would you mind updating the PR to rc2? I would like to release this when also final 5.2 of Rails is out but we can merge it into a separate branch for the moment. |
c80a563
to
81a73c7
Compare
@coorasse updated to rc2 |
@coorasse Rails 5.2 was released today. Any plans on releasing this? Thanks |
please @lizzyaustad , can you use the final 5.2 and add your changes to the CHANGELOG? Then I can merge and release a new 2.2.0 version. Thank you very much for your work, really appreciated 👍 |
81a73c7
to
8b32f03
Compare
Hi @coorasse, I've updated to the final 5.2 version of rails and added my change to the "Unreleased" section of the changelog. Let me know if there's anything else I should do. Thanks! |
Thank you! Nice job! |
Add support for Rails 5.2
Add support for Rails 5.2
Add support for Rails 5.2
Required for the Rails 5.2 upgrade; specifically, CanCanCommunity/cancancan#479 is required to fix an ActiveRecord query issue that we're seeing on controllers with autoloaded resources. Reading through the changelog, it looks like the only major changes between this and our previous version are [several deprecations](https://github.com/CanCanCommunity/cancancan/blob/develop/CHANGELOG.md#200-may-18th-2017) for situations we aren't using.
A change in the most recent beta version of Rails 5.2 wraps the query attribute in a BindParam node, making the attribute's value inaccessible when it comes back to cancancan.
If the change persists in the final version of Rails 5.2,
SubstituteBinds
could be a possible solution for avoiding the SQL error that is otherwise raised. Without this change, current active record adapter tests would fail for the 5.2.0.beta2 appraisal. I can update the gem to the non-beta version so this PR can be up to date once the final version is released if the issue still exists at that point.