Module: ActiveHashRelation::ScopeFilters
- Included in:
- FilterApplier
- Defined in:
- lib/active_hash_relation/scope_filters.rb
Instance Method Summary collapse
Instance Method Details
#filter_scopes(resource, params, model = nil) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/active_hash_relation/scope_filters.rb', line 2 def filter_scopes(resource, params, model = nil) unless model model = model_class_name(resource) end model.scope_names.each do |scope| if params.include?(scope) resource = resource.send(scope) end end return resource end |