Sha256: a6f1c2374b12146725680d060db7e1d02d68fce9250e707565a49d70c03bdb99

Contents?: true

Size: 378 Bytes

Versions: 33

Compression:

Stored size: 378 Bytes

Contents

class Agilibox::SmallData::FilterStrategyByKeyValues < ::Agilibox::SmallData::FilterStrategy
  attr_reader :key

  def initialize(key = nil)
    @key = key
  end

  def apply(query, value)
    value = value.split(" ") if value.is_a?(String)
    value = value.select(&:present?)

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

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
agilibox-1.5.5 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.5.4 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.5.3 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.5.2 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.5.1 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.5.0 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.4.4 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.4.3 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.4.2 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.4.1 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.4.0 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.3.6 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.3.5 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.3.4 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.3.3 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.3.2 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.3.1 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.3.0 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.2.3 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb
agilibox-1.2.2 app/filters/agilibox/small_data/filter_strategy_by_key_values.rb