Sha256: 996806b3fbd3e48a6821032ef44d142decdfab38f57a698d71b9ed4fcc7aeabc

Contents?: true

Size: 528 Bytes

Versions: 12

Compression:

Stored size: 528 Bytes

Contents

class Datagrid::Filters::BooleanEnumFilter < Datagrid::Filters::EnumFilter

  YES = "YES"
  NO = "NO"

  def initialize(report, attribute, options = {}, &block)
    options[:select] = [YES, NO].map do |key, value|
      [I18n.t("datagrid.filters.eboolean.#{key.downcase}", :default => key.humanize), key]
    end
    super(report, attribute, options, &block)
  end

  def apply(grid_object, scope, value)
    super(grid_object, scope, value)
  end

  def to_boolean(value)
    #TODO decide what to do with conversion
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
datagrid-0.9.3 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.9.2 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.9.0 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.8.4 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.8.3 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.8.2 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.8.1 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.8.0 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.7.1 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.7.0 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.6.4 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-0.6.3 lib/datagrid/filters/boolean_enum_filter.rb