Class: JsonapiCompliable::Scope::DefaultFilter

Inherits:
Base
  • Object
show all
Includes:
Filterable
Defined in:
lib/jsonapi_compliable/scope/default_filter.rb

Instance Attribute Summary

Attributes inherited from Base

#controller, #dsl, #params, #scope

Instance Method Summary collapse

Methods included from Filterable

#filter_param, #find_filter, #find_filter!

Methods inherited from Base

#apply_custom_scope, #apply_standard_or_override, #apply_standard_scope, #apply_standard_scope?, #initialize

Constructor Details

This class inherits a constructor from JsonapiCompliable::Scope::Base

Instance Method Details

#apply ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/jsonapi_compliable/scope/default_filter.rb', line 5

def apply
  dsl.default_filters.each_pair do |name, opts|
    next if overridden?(name)
    @scope = opts[:filter].call(@scope)
  end

  @scope
end