6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/dscf/marketplace/products_controller.rb', line 6
def filter
authorize @clazz.new, :filter?
products = @clazz.all
if params[:q].present?
products = products.ransack(params[:q]).result
end
products = products.includes(eager_loaded_associations) if eager_loaded_associations.present?
includes = serializer_includes_for_action(:index)
options = {}
options[:include] = includes if includes.present?
render_success(data: products, serializer_options: options)
end
|