Sha256: afe3577db50743d699c3812a7f4e6f41cbea88c08329ea9e0a6aa5575e58294f

Contents?: true

Size: 496 Bytes

Versions: 7

Compression:

Stored size: 496 Bytes

Contents

module Godmin
  module Resources
    module ResourceService
      module Associations
        extend ActiveSupport::Concern

        delegate :has_many_map, to: "self.class"

        module ClassMethods
          def has_many_map
            @has_many_map ||= {}
          end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
godmin-2.3.0 lib/godmin/resources/resource_service/associations.rb
godmin-2.2.2 lib/godmin/resources/resource_service/associations.rb
godmin-2.2.1 lib/godmin/resources/resource_service/associations.rb
godmin-2.2.0 lib/godmin/resources/resource_service/associations.rb
godmin-2.1.0 lib/godmin/resources/resource_service/associations.rb
godmin-2.0.0 lib/godmin/resources/resource_service/associations.rb
godmin-1.5.0 lib/godmin/resources/resource_service/associations.rb