Sha256: 73a3386d491aa648be7a5bdcb19689a5a558d46de033ab41b7874252da4d1b35

Contents?: true

Size: 586 Bytes

Versions: 302

Compression:

Stored size: 586 Bytes

Contents

module Avo
  module Filters
    class MultipleSelectFilter < BaseFilter
      self.template = "avo/base/multiple_select_filter"

      # The input expects an array of strings for the value
      # Ex: ['admins', 'non_admins']
      def selected_value(applied_filters)
        # Get the values for this particular filter
        applied_value = applied_filters[self.class.to_s]

        # Return that value if present
        return applied_value unless applied_value.nil?

        # Return that default
        return default unless default.nil?

        []
      end
    end
  end
end

Version data entries

302 entries across 302 versions & 1 rubygems

Version Path
avo-3.14.3 lib/avo/filters/multiple_select_filter.rb
avo-3.14.2 lib/avo/filters/multiple_select_filter.rb
avo-3.14.1 lib/avo/filters/multiple_select_filter.rb
avo-3.14.0 lib/avo/filters/multiple_select_filter.rb
avo-3.13.7 lib/avo/filters/multiple_select_filter.rb
avo-3.13.6 lib/avo/filters/multiple_select_filter.rb
avo-3.13.5 lib/avo/filters/multiple_select_filter.rb
avo-3.13.4 lib/avo/filters/multiple_select_filter.rb
avo-3.13.3 lib/avo/filters/multiple_select_filter.rb
avo-3.13.2 lib/avo/filters/multiple_select_filter.rb
avo-3.13.1 lib/avo/filters/multiple_select_filter.rb
avo-3.13.0 lib/avo/filters/multiple_select_filter.rb
avo-2.53.0 lib/avo/filters/multiple_select_filter.rb
avo-3.12.0 lib/avo/filters/multiple_select_filter.rb
avo-3.11.10 lib/avo/filters/multiple_select_filter.rb
avo-3.11.9 lib/avo/filters/multiple_select_filter.rb
avo-3.11.8 lib/avo/filters/multiple_select_filter.rb
avo-3.11.7 lib/avo/filters/multiple_select_filter.rb
avo-3.11.6 lib/avo/filters/multiple_select_filter.rb
avo-3.11.5 lib/avo/filters/multiple_select_filter.rb