Module: SimpleListing::Filterable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Standard
- Defined in:
- lib/simple_listing/filterable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#filter_params ⇒ Object
34 35 36 |
# File 'lib/simple_listing/filterable.rb', line 34 def filter_params params[config[:filter_params_key]] end |
#perform ⇒ Object
28 29 30 31 32 |
# File 'lib/simple_listing/filterable.rb', line 28 def perform super apply_filters if should_be_filtered? scope end |
#should_be_filtered? ⇒ Boolean
38 39 40 |
# File 'lib/simple_listing/filterable.rb', line 38 def should_be_filtered? filter_params && filter_params.respond_to?(:each) end |