From 45d0d18baef2de739dae89bb7bc79826392bbde5 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Thu, 6 Jan 2011 19:32:05 +0000 Subject: Not really worth having the HasAssociation module for just a single method --- .../lib/active_record/associations/association_proxy.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/associations/association_proxy.rb') diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb index 405a0307c1..294e1cab50 100644 --- a/activerecord/lib/active_record/associations/association_proxy.rb +++ b/activerecord/lib/active_record/associations/association_proxy.rb @@ -9,11 +9,11 @@ module ActiveRecord # AssociationProxy # BelongsToAssociation # BelongsToPolymorphicAssociation - # AssociationCollection + HasAssociation + # AssociationCollection # HasAndBelongsToManyAssociation # HasManyAssociation # HasManyThroughAssociation + ThroughAssociation - # HasOneAssociation + HasAssociation + # HasOneAssociation # HasOneThroughAssociation + ThroughAssociation # # Association proxies in Active Record are middlemen between the object that @@ -252,6 +252,13 @@ module ActiveRecord table.create_and(conditions) end + # 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 + private # Forwards any missing method call to the \target. def method_missing(method, *args) -- cgit v1.2.3