Module: Godmin::Resources::ResourceService::Associations::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

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



14
15
16
17
18
# File 'lib/godmin/resources/resource_service/associations.rb', line 14

def has_many(attr, options = {})
  has_many_map[attr] = {
    class_name: attr.to_s.singularize.classify
  }.merge(options)
end

#has_many_mapObject



10
11
12
# File 'lib/godmin/resources/resource_service/associations.rb', line 10

def has_many_map
  @has_many_map ||= {}
end