Sha256: 142e694cce7140edff4a7c6d36e14915f40d25f60c431d0ef46603ee7051f8fb
Contents?: true
Size: 546 Bytes
Versions: 44
Compression:
Stored size: 546 Bytes
Contents
require "datagrid/filters/select_options" class Datagrid::Filters::EnumFilter < Datagrid::Filters::BaseFilter include Datagrid::Filters::SelectOptions def initialize(*args) super(*args) if checkboxes? options[:multiple] = true end raise Datagrid::ConfigurationError, ":select option not specified" unless options[:select] end def parse(value) return nil if self.strict && !select.include?(value) value end def strict options[:strict] end def checkboxes? options[:checkboxes] end end
Version data entries
44 entries across 44 versions & 1 rubygems