Open
Description
When defining a query
block on a dynamic filter, the default logic applied by Ransack behind the scenes is overridden, giving the developer full control over the application of the query logic.
This is great, however, sometimes, that is not the desired behavior. For example, we may want to retain the default behavior but wrap the query in a scope to apply the Mobility gem.
In such cases, a helper that applies the default query logic would be helpful.
I don't have a clear vision of what it would look like, but here are some ideas:
- Pass two queries to the
query
block.
field :tourist_destination, as: :boolean, filterable: {
query: -> {
query # clean query
query_with_defaults # query with defaults applied
}
}
- Add a helper that applies defaults.
field :tourist_destination, as: :boolean, filterable: {
query: -> {
query = apply_defaults(query: query)
}
}
Metadata
Metadata
Assignees
Type
Projects
Status
Triage