Sha256: 4a6438953efaf32c741f0bd5f5b42c8378419d43d959a53d1d7d4274eca9edcc

Contents?: true

Size: 336 Bytes

Versions: 13

Compression:

Stored size: 336 Bytes

Contents

# frozen_string_literal: true

module ActiveResource::Associations::Builder
  class HasOne < Association
    self.macro = :has_one

    def build
      validate_options
      model.create_reflection(self.class.macro, name, options).tap do |reflection|
        model.defines_has_one_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_one.rb
activeresource-6.1.3 lib/active_resource/associations/builder/has_one.rb
activeresource-6.1.2 lib/active_resource/associations/builder/has_one.rb
activeresource-6.1.1 lib/active_resource/associations/builder/has_one.rb
activeresource-6.1.0 lib/active_resource/associations/builder/has_one.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/activeresource-5.1.1/lib/active_resource/associations/builder/has_one.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/activeresource-5.1.1/lib/active_resource/associations/builder/has_one.rb
activeresource-6.0.0 lib/active_resource/associations/builder/has_one.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/activeresource-5.1.1/lib/active_resource/associations/builder/has_one.rb
activeresource-5.1.1 lib/active_resource/associations/builder/has_one.rb
ric-0.13.0 vendor/bundle/ruby/2.5.0/gems/activeresource-5.1.0/lib/active_resource/associations/builder/has_one.rb
ric-0.12.2 vendor/bundle/ruby/2.5.0/gems/activeresource-5.1.0/lib/active_resource/associations/builder/has_one.rb
activeresource-5.1.0 lib/active_resource/associations/builder/has_one.rb