Module: Godmin::Resources::ResourceService::Filters::ClassMethods

Defined in:
lib/godmin/resources/resource_service/filters.rb

Instance Method Summary collapse

Instance Method Details

#filter(attr, options = {}) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/godmin/resources/resource_service/filters.rb', line 32

def filter(attr, options = {})
  filter_map[attr] = {
    as: :string,
    option_text: "to_s",
    option_value: "id",
    collection: nil
  }.merge(options)
end

#filter_mapObject



28
29
30
# File 'lib/godmin/resources/resource_service/filters.rb', line 28

def filter_map
  @filter_map ||= {}
end