Sha256: d4adaefa6fadca584a63a441bd2e490fcca40b1e88b5b0eb95e21236a46fdb51
Contents?: true
Size: 753 Bytes
Versions: 19
Compression:
Stored size: 753 Bytes
Contents
module AdminIt # class FieldFilter < Filter dsl do dsl_accessor :field end class << self attr_reader :field protected def default_display_name field.nil? ? superclass.default_display_name : field.display_name end end class_attr_reader :field def self.create(name, _resource, _field) field_class = create_class(name, _resource) field_class.class_eval do _field = _field.to_sym if _field.is_a?(String) @field = if _field <= Field _field elsif _field.is_a?(Symbol) @resource.fields.find { |fld| fld.field_name == _field } else nil end end field_class end end end
Version data entries
19 entries across 19 versions & 1 rubygems