aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_association.rb
blob: 8b180c7301e821a99e2d9bfb4745a676ec3ae8b8 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                                                


       
module ActiveRecord
  module Associations
    # Included in all has_* associations (i.e. everything except belongs_to)
    module HasAssociation #:nodoc:
      protected
        # Sets the owner attributes on the given record
        def set_owner_attributes(record)
          if @owner.persisted?
            construct_owner_attributes.each { |key, value| record[key] = value }
          end
        end
    end
  end
end