Skip to content

Use beginless range for query instead of < ? #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

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

bensheldon
Copy link
Contributor

This seems a little trivial to suggest (sorry!) but using a range in Rails 7.1 turns the query value into a proper bind parameter and preparable statement. This will become unnecessary in the next release of Rails. And I like the beginless/endless queries and all the other queries in SolidQueue that I could find use this style too 👍🏻

Here's a writeup with a little more info: https://island94.org/2024/03/rails-active-record-will-it-bind

@rosa
Copy link
Member

rosa commented Apr 1, 2024

Ooh, great catch! Thank you so much 🙏 And great article too 💯

@rosa rosa merged commit 511f1ff into rails:main Apr 1, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants