Sha256: 0acce95eeef1e4b00c696857a0dac40636dcfd95ef1df099131990850e9aaf60

Contents?: true

Size: 317 Bytes

Versions: 3

Compression:

Stored size: 317 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

3 entries across 3 versions & 1 rubygems

Version Path
active_hash_relation-1.1.0 lib/active_hash_relation/scope_filters.rb
active_hash_relation-1.0.5 lib/active_hash_relation/scope_filters.rb
active_hash_relation-1.0.4 lib/active_hash_relation/scope_filters.rb