lib/parelation/applier.rb
def apply_to_chain
    params.each do |param, value|
      CRITERIA.each do |criteria|
        if criteria.match?(param)
          begin
            @chain = criteria.new(chain, param, value).call
          rescue
            raise Parelation::Errors::Parameter,
              "the #{param} parameter is invalid"
          end
        end
      end
    end

    chain
  end
# Iterates over each user-provided parameter and incrementally
# updates the {#chain} to incorporate the user-requested criteria.
#
# @return [ActiveRecord::Relation]
#
Iterates over each user-provided parameter and incrementally
updates the {#chain} to incorporate the user-requested criteria.
Iterates over each user - provided parameter and incrementally updates the { #chain } to incorporate the user - requested criteria .
def apply_to_chain
    params.each do |param, value|
      CRITERIA.each do |criteria|
        if criteria.match?(param)
          begin
            @chain = criteria.new(chain, param, value).call
          rescue
            raise Parelation::Errors::Parameter,
              "the #{param} parameter is invalid"
          end
        end
      end
    end
    chain
  end
def apply_to_chain params . each do | param , value | CRITERIA . each do | criteria | if criteria . match? ( param ) begin @chain = criteria . new ( chain , param , value ) . call rescue raise Parelation :: Errors :: Parameter , "the #{param} parameter is invalid" end end end end chain end
Iterates over each user-provided parameter and incrementally
updates the {#chain} to incorporate the user-requested criteria.
Iterates over each user - provided parameter and incrementally updates the { #chain } to incorporate the user - requested criteria .
None
ActiveRecord::Relation