Module: Godmin::Resources::ResourceService::Filters

Extended by:
ActiveSupport::Concern
Included in:
Godmin::Resources::ResourceService
Defined in:
lib/godmin/resources/resource_service/filters.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#apply_filters(filter_params, resources) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/godmin/resources/resource_service/filters.rb', line 9

def apply_filters(filter_params, resources)
  if filter_params.present?
    filter_params.each do |name, value|
      if apply_filter?(name, value)
        resources = send("filter_#{name}", resources, value)
      end
    end
  end
  resources
end