Sha256: a99475d22dee4f85fd4624df39122f75a5c49562e419f88a0dd994ec4dac8bec

Contents?: true

Size: 340 Bytes

Versions: 8

Compression:

Stored size: 340 Bytes

Contents

class BMC::Filter::ByKeyValues < BMC::Filter::ByKeyValue
  def apply(query, value)
    value = value.split if value.is_a?(String)
    value = value.select(&:present?)

    return query if value == ["all"]

    column = column_for(query)

    if value.any?
      query.where("#{column} IN (?)", value)
    else
      query
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bmc-1.5.1 app/filters/bmc/filter/by_key_values.rb
bmc-1.5.0 app/filters/bmc/filter/by_key_values.rb
bmc-1.4.3 app/filters/bmc/filter/by_key_values.rb
bmc-1.4.2 app/filters/bmc/filter/by_key_values.rb
bmc-1.4.1 app/filters/bmc/filter/by_key_values.rb
bmc-1.4.0 app/filters/bmc/filter/by_key_values.rb
bmc-1.3.5 app/filters/bmc/filter/by_key_values.rb
bmc-1.3.4 app/filters/bmc/filter/by_key_values.rb