Casecommons / pg_search

pg_search builds ActiveRecord named scopes that take advantage of PostgreSQL’s full text search
http://www.casebook.net
MIT License
1.3k stars 369 forks source link

Fix compatibility with ActiveRecord 7.2 #535

Closed fatkodima closed 1 month ago

fatkodima commented 2 months ago

The interface for Or arel node was changed in https://github.com/rails/rails/pull/51492. This currently prevents our upgrade to rails 7.2.

Fixes #536.

nertzy commented 2 months ago

Also it looks like the undercover code coverage tool is getting triggered for the new branch not having code coverage on both sides, but that doesn't make sense in this case so I'll have to figure out a way to improve that gate or disable it here.

fatkodima commented 2 months ago

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%). 🤷 Imo, only like running it locally for yourself to verify that you actually tested what you wanted is useful.

fatkodima commented 1 month ago

@nertzy Sorry for pinging, but can you reconsider this PR and release a new version with the fix?

nertzy commented 1 month ago

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!

fatkodima commented 1 month ago

Thank you ❤️