Sha256: cccf70e067264b49df49a7b1abd7a446d1efa67cf6c4749a234943d709b24b46

Contents?: true

Size: 384 Bytes

Versions: 39

Compression:

Stored size: 384 Bytes

Contents

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

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

  def apply(query, value)
    value = true  if value == "true"
    value = false if value == "false"
    value = nil   if value == "nil"
    value = nil   if value == "null"

    query.where("#{key} = ?", value)
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
agilibox-1.2.1 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.2.0 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.1.0 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.15 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.14 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.13 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.12 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.11 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.10 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.9 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.8 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.7 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.6 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.5 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.4 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.3 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.2 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.1 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb
agilibox-1.0.0 app/filters/agilibox/small_data/filter_strategy_by_key_value.rb