Sha256: d49875aede66a2920f76241641f238d4c659e6660491f16ec46d303452b9627e

Contents?: true

Size: 316 Bytes

Versions: 7

Compression:

Stored size: 316 Bytes

Contents

module ActiveHashRelation::ScopeFilters
  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
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_hash_relation-1.0.3 lib/active_hash_relation/scope_filters.rb
active_hash_relation-1.0.2 lib/active_hash_relation/scope_filters.rb
active_hash_relation-1.0.1 lib/active_hash_relation/scope_filters.rb
active_hash_relation-1.0.0 lib/active_hash_relation/scope_filters.rb
active_hash_relation-0.0.3 lib/active_hash_relation/scope_filters.rb
active_hash_relation-0.0.2 lib/active_hash_relation/scope_filters.rb
active_hash_relation-0.0.1 lib/active_hash_relation/scope_filters.rb