Sha256: 078463bd5b2dc4762d9d174508bf60c588fb38466c9cfbe79b1ed9b7999d4bf1

Contents?: true

Size: 475 Bytes

Versions: 22

Compression:

Stored size: 475 Bytes

Contents

class Datagrid::Filters::BooleanEnumFilter < Datagrid::Filters::EnumFilter #:nodoc:

  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.downcase.capitalize), key]
    end
    super(report, attribute, options, &block)
  end


  def checkbox_id(value)
    [object_name, name, value].join('_').underscore 
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
datagrid-1.6.3 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.6.2 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.6.1 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.6.0 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.5.9 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.5.8 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.5.7 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.5.6 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.5.5 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.5.4 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.5.3 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.5.2 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.5.1 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.5.0 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.4.4 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.4.3 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.4.2 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.4.1 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.4.0 lib/datagrid/filters/boolean_enum_filter.rb
datagrid-1.3.9 lib/datagrid/filters/boolean_enum_filter.rb