Sha256: 72e8a3e63085c18e8d87fce2cc409039a08bd0c505e44e4880c5afa2bfe611ed

Contents?: true

Size: 481 Bytes

Versions: 10

Compression:

Stored size: 481 Bytes

Contents

# frozen_string_literal: true

module Clowne
  module Adapters # :nodoc: all
    class ActiveRecord
      module Associations
        class HasMany < Base
          def call(record)
            with_scope.each do |child|
              child_clone = clone_one(child)
              child_clone[:"#{reflection.foreign_key}"] = nil
              record.__send__(association_name) << child_clone
            end

            record
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
clowne-1.5.0 lib/clowne/adapters/active_record/associations/has_many.rb
clowne-1.4.0 lib/clowne/adapters/active_record/associations/has_many.rb
clowne-1.3.0 lib/clowne/adapters/active_record/associations/has_many.rb
clowne-1.2.0 lib/clowne/adapters/active_record/associations/has_many.rb
clowne-1.1.0 lib/clowne/adapters/active_record/associations/has_many.rb
clowne-1.0.0 lib/clowne/adapters/active_record/associations/has_many.rb
clowne-0.2.0 lib/clowne/adapters/active_record/associations/has_many.rb
clowne-0.1.0 lib/clowne/adapters/active_record/associations/has_many.rb
clowne-0.1.0.beta1 lib/clowne/adapters/active_record/associations/has_many.rb
clowne-0.1.0.pre1 lib/clowne/adapters/active_record/associations/has_many.rb