jhund / filterrific

Filterrific is a Rails Engine plugin that makes it easy to filter, search, and sort your ActiveRecord lists.
http://filterrific.clearcove.ca
MIT License
910 stars 125 forks source link

Check Available Filters in Model #158

Open rorong opened 6 years ago

rorong commented 6 years ago

Controller Code

@filterrific = initialize_filterrific( User.all, params[:filterrific], select_options: { sorted_by: User.options_for_sorted_by }

Model Code

filterrific( available_filters: [ :sorted_by, :with_name, :with_role, :with_start, :with_end, :from_ticket_ans, ] ) scope :with_end, -> (with_end) do where('date(users.created_at) <= ?', with_end) end

In above with_end scope i want to check if with_start scope is called and what is the params pass to it

Actually i Want all filterrific params in any scope please provide me solution