-
Notifications
You must be signed in to change notification settings - Fork 372
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
Fix compatibility with ActiveRecord 7.2 #535
Conversation
lib/pg_search/scope_options.rb
Outdated
.map { |feature_name, _feature_options| feature_for(feature_name).conditions } | ||
|
||
# https://github.com/rails/rails/pull/51492 | ||
if ActiveRecord.version >= Gem::Version.new("7.2.0.beta1") |
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.
This is great! I'm wondering, should we change this to check Arel's version instead?
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.
No, because the arel version hasn't changed in 6 years (from git blame).
Also it looks like the |
I once was convinced that code coverage tools are pretty useless, especially for caring too much about its numbers (if it becomes higher/lower or should be 99%). 🤷 |
@nertzy Sorry for pinging, but can you reconsider this PR and release a new version with the fix? |
b6c4af6
to
b3d334d
Compare
Thanks! I updated the implementation to do a single check at require time, and based it on a direct arity check of the constructor instead of using the version. Looks great, thanks for this fix! |
Thank you ❤️ |
The interface for
Or
arel node was changed in rails/rails#51492.This currently prevents our upgrade to rails 7.2.
Fixes #536.