Open Paul-Bob opened 4 days ago
As a follow up for https://github.com/avo-hq/avo/issues/2885 lets also enable resource level configuration for the search query limit.
results_count
Avo::ExecutionContext
search_query
Avo.configuration.search_results_count
Final DSL should look like:
class Avo::Resources::User < Avo::BaseResource self.search = { query: -> { query.ransack(name_eq: params[:q]).result(distinct: false) }, results_count: -> { user.admin ? 30 : 10 } } end
Could this be assigned to me?
Context
As a follow up for https://github.com/avo-hq/avo/issues/2885 lets also enable resource level configuration for the search query limit.
Approach
results_count
from the search options like we do with the query hereAvo::ExecutionContext
like we do with thesearch_query
hereresults_count
can be both, an integer or a Procresults_count
takes precedence over the global configurationAvo.configuration.search_results_count
Final DSL should look like: