-
Notifications
You must be signed in to change notification settings - Fork 292
Open
Description
Seems like groupings and custom scopes don't play nice in ransack: activerecord-hackery/ransack#1339
The Ajax select will always structure the query in a grouping:
activeadmin_addons/app/javascript/activeadmin_addons/inputs/search-select.js
Lines 40 to 46 in 51a0e4b
var query = { | |
order: order, | |
q: { | |
groupings: [textQuery], | |
combinator: 'and', | |
}, | |
}; |
Even in the case of a single parameter. A simple query will look something like this:
Would it be possible not to use groupings unless necessary? As long as custom scopes are passed on top-level this would enable filtering to work with custom scopes. It would also make queries easier to understand. The following are equivalent
{ groupings: [{m: 'or', user_name_contains: 'hug'}, combinator: 'and']}
# vs
{ user_name_contains: 'jov' }
stefsava
Metadata
Metadata
Assignees
Labels
No labels