Sha256: 69d4f67ea6130f1a8627dc8293ef05da070cea65e69cc07ff86aa8ef9c96b2cd

Contents?: true

Size: 339 Bytes

Versions: 13

Compression:

Stored size: 339 Bytes

Contents

# frozen_string_literal: true

module ActiveResource::Associations::Builder
  class HasMany < Association
    self.macro = :has_many

    def build
      validate_options
      model.create_reflection(self.class.macro, name, options).tap do |reflection|
        model.defines_has_many_finder_method(reflection)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
activeresource-6.1.4 lib/active_resource/associations/builder/has_many.rb
activeresource-6.1.3 lib/active_resource/associations/builder/has_many.rb
activeresource-6.1.2 lib/active_resource/associations/builder/has_many.rb
activeresource-6.1.1 lib/active_resource/associations/builder/has_many.rb
activeresource-6.1.0 lib/active_resource/associations/builder/has_many.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/activeresource-5.1.1/lib/active_resource/associations/builder/has_many.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/activeresource-5.1.1/lib/active_resource/associations/builder/has_many.rb
activeresource-6.0.0 lib/active_resource/associations/builder/has_many.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/activeresource-5.1.1/lib/active_resource/associations/builder/has_many.rb
activeresource-5.1.1 lib/active_resource/associations/builder/has_many.rb
ric-0.13.0 vendor/bundle/ruby/2.5.0/gems/activeresource-5.1.0/lib/active_resource/associations/builder/has_many.rb
ric-0.12.2 vendor/bundle/ruby/2.5.0/gems/activeresource-5.1.0/lib/active_resource/associations/builder/has_many.rb
activeresource-5.1.0 lib/active_resource/associations/builder/has_many.rb