-
Notifications
You must be signed in to change notification settings - Fork 82
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
AR - Order clause has issues with multiple parameters #565
Comments
Seems like a genuine issue, I'll try to have a look. |
This should be a straightforward fix, if anyone wants to have a go at it I'll review any PRs. Otherwise will probably take me a few weeks, I'm very busy until after RailsConf. |
Hi, thanks fro the feedback. I've tried myself to fix but it isn't so easy for me. The problem is that multiple symbols are not passed as array, and the previous scope is not maintained in the
I'm trying to use the same approach as I've added some failing specs at tagliala@91d827a |
Hi, from time to time I'm still attempting to fix this issue I've added more failing specs, and I think that Mobility needs something like preprocess_order_args |
Thanks @tagliala, yes this seems to be a bit more complicated than when I originally added support for order... 😭 You're right that |
Hi,
I'm opening this issue to track an issue I've found with
order
clause on multiple columnsContext
ActiveRecord 7.0
Mobility 1.2.6
Issue 1 - 1st parameter is not translatable
Expected Behavior
Orders by translated attribute
Actual Behavior
Does not order by translated attribute
Issue 2 - 1st parameter is translatable
Expected Behavior
Keeps in account nth parameter where n >= 2
Actual Behavior
Discards nth parameter where n >= 2
Workaround
Concatenate order clauses
Possible Fix
mobility/lib/mobility/plugins/active_record/query.rb
Lines 142 to 158 in 7683433
Add support to array of fieldschange the implementation to correctly manageargs
The text was updated successfully, but these errors were encountered: