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.11.4 lib/avo/filters/multiple_select_filter.rb
avo-3.11.3 lib/avo/filters/multiple_select_filter.rb
avo-3.11.2 lib/avo/filters/multiple_select_filter.rb
avo-3.11.1 lib/avo/filters/multiple_select_filter.rb
avo-3.11.0 lib/avo/filters/multiple_select_filter.rb
avo-2.52.0 lib/avo/filters/multiple_select_filter.rb
avo-3.10.10 lib/avo/filters/multiple_select_filter.rb
avo-3.10.9 lib/avo/filters/multiple_select_filter.rb
avo-3.10.8 lib/avo/filters/multiple_select_filter.rb
avo-3.10.7 lib/avo/filters/multiple_select_filter.rb
avo-3.10.6 lib/avo/filters/multiple_select_filter.rb
avo-3.10.5 lib/avo/filters/multiple_select_filter.rb
avo-3.10.4 lib/avo/filters/multiple_select_filter.rb
avo-3.10.3 lib/avo/filters/multiple_select_filter.rb
avo-3.10.2 lib/avo/filters/multiple_select_filter.rb
avo-3.10.1 lib/avo/filters/multiple_select_filter.rb
avo-3.10.0 lib/avo/filters/multiple_select_filter.rb
avo-3.9.2 lib/avo/filters/multiple_select_filter.rb
avo-3.9.1 lib/avo/filters/multiple_select_filter.rb
avo-3.8.2 lib/avo/filters/multiple_select_filter.rb