Sha256: 896fd8ddd4b75d6b648cff5b0abb975164f9607c3e18b9d1af3b3b35d2fe3334
Contents?: true
Size: 451 Bytes
Versions: 10
Compression:
Stored size: 451 Bytes
Contents
class Datagrid::Filters::BooleanEnumFilter < Datagrid::Filters::EnumFilter YES = "YES" NO = "NO" VALUES = ActiveSupport::OrderedHash.new VALUES[YES] = YES VALUES[NO] = NO def initialize(report, attribute, options = {}, &block) options[:select] = VALUES.keys super(report, attribute, options, &block) end def apply(scope, value) super(scope, to_boolean(value)) end def to_boolean(value) VALUES[value] end end
Version data entries
10 entries across 10 versions & 1 rubygems