Sha256: 584cef1f5f03c2669724ee33a891df862d73118b784ce9433d157670fa1d47e1

Contents?: true

Size: 619 Bytes

Versions: 343

Compression:

Stored size: 619 Bytes

Contents

module Avo
  module Filters
    class BooleanFilter < BaseFilter
      self.template = "avo/base/boolean_filter"

      def selected_value(item, applied_filters)
        # See if there are any applied rules for this particular filter
        if applied_filters[self.class.to_s].present?
          # Symbolize the keys because they are returned from de-serialization (JSON and Base64)
          applied_filters[self.class.to_s].stringify_keys.dig(item.to_s)
        else
          applied_or_default_value(applied_filters).stringify_keys.dig(item.to_s)
        end
      rescue
        false
      end
    end
  end
end

Version data entries

343 entries across 343 versions & 1 rubygems

Version Path
avo-3.18.1.tw4 lib/avo/filters/boolean_filter.rb
avo-3.18.1 lib/avo/filters/boolean_filter.rb
avo-3.18.0.tw4 lib/avo/filters/boolean_filter.rb
avo-3.18.0 lib/avo/filters/boolean_filter.rb
avo-3.17.9.beta2 lib/avo/filters/boolean_filter.rb
avo-3.17.9.beta1 lib/avo/filters/boolean_filter.rb
avo-3.17.9.tw4 lib/avo/filters/boolean_filter.rb
avo-3.17.9 lib/avo/filters/boolean_filter.rb
avo-3.17.8.tw4 lib/avo/filters/boolean_filter.rb
avo-3.17.8 lib/avo/filters/boolean_filter.rb
avo-3.17.7 lib/avo/filters/boolean_filter.rb
avo-3.17.6.tw4 lib/avo/filters/boolean_filter.rb
avo-3.17.6 lib/avo/filters/boolean_filter.rb
avo-3.17.5 lib/avo/filters/boolean_filter.rb
avo-3.17.4 lib/avo/filters/boolean_filter.rb
avo-3.17.3 lib/avo/filters/boolean_filter.rb
avo-3.17.5.tw4 lib/avo/filters/boolean_filter.rb
avo-3.17.4.tw4 lib/avo/filters/boolean_filter.rb
avo-3.17.3.tw4 lib/avo/filters/boolean_filter.rb
avo-3.17.2.tw4 lib/avo/filters/boolean_filter.rb