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
Support beginless ranges in hash conditions. #36696
Conversation
Ruby 2.7 introduces beginless ranges (..value and ...value) and as with endless ranges we can turn these into inequalities, enabling expressions such as Order.where(created_at: ..1.year.ago) User.where(karma: ...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.
Thank you for the patch.
For the reference, Ruby commit that introduces this was https://bugs.ruby-lang.org/issues/14799
Given that this feature is in 2.7.0.preview1, I think it's ok to support it.
I've confirmed test has passed with ruby-trunk locally since CI for ruby-trunk is broken for now.
|
Support beginless ranges in hash conditions.
Summary
Ruby 2.7 introduces beginless ranges (
..value
and...value
) and as with endless ranges we can turn these into inequalities, enabling expressions such asOther Information
Ruby 2.7 may not be released yet, but It is Coming.