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
QueryMethods#in_order_of
drop records not listed
#44097
Conversation
`in_order_of` now filters down to the values provided, to match the behavior of the `Enumerable` version. *Kevin Newton*
That was my plan, specially that it is only release for 3 weeks. |
sorry for interfering, if you plan backport this to 7.0 maybe will be good to not forget backport original PR #43916 |
@AlexKovynev not sure if I'm missing something, but I believe that PR is already there. |
`QueryMethods#in_order_of` drop records not listed
Would you guys mind if I added an optional
|
@chaadow did you get around creating a PR for that? I'd love to have that functionality as well. |
@chaadow @gstokkink I was surprised by this behavior too. Here's what I'm using as a workaround: in_order_of(:priority, %w[urgent high medium]).unscope(where: :priority) |
I'm also curious if an option is in the works -- we're just upgrading to Rails 7.0 now and were surprised that an order predicate would limit rows returned. |
I was also surprised by this behavior. @guigs workaround works, you just gotta be careful in case you have another (intentional) where on that column. |
in_order_of
now filters down to the values provided, to match the behavior of theEnumerable
version.This is in response to #43916 (comment). It's working to match the
Enumerable
version, but since it was released I'm not sure of the migration path. Maybe it could be considered a bug and be a part of a patch release? Not sure.