diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-01-09 18:37:01 +0000 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-11 13:45:08 -0800 |
commit | 681ab53ba15f9fc95c8a91e50bb0138aa66967b2 (patch) | |
tree | 0b819a5f2fe4e3e648876f134104d3c451adcb34 /activerecord/lib/active_record/associations/class_methods | |
parent | 42b2e4f85bef64b7aa1382e96c79db1d4f318a56 (diff) | |
download | rails-681ab53ba15f9fc95c8a91e50bb0138aa66967b2.tar.gz rails-681ab53ba15f9fc95c8a91e50bb0138aa66967b2.tar.bz2 rails-681ab53ba15f9fc95c8a91e50bb0138aa66967b2.zip |
Get rid of set_association_target and association_loaded? as the parts of the code that need that can now just use association_proxy(:name).loaded?/target=
Diffstat (limited to 'activerecord/lib/active_record/associations/class_methods')
-rw-r--r-- | activerecord/lib/active_record/associations/class_methods/join_dependency.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/class_methods/join_dependency.rb b/activerecord/lib/active_record/associations/class_methods/join_dependency.rb index 6263c4e3b0..cb3edafab1 100644 --- a/activerecord/lib/active_record/associations/class_methods/join_dependency.rb +++ b/activerecord/lib/active_record/associations/class_methods/join_dependency.rb @@ -223,7 +223,8 @@ module ActiveRecord end def set_target_and_inverse(join_part, association, record) - association_proxy = record.send("set_#{join_part.reflection.name}_target", association) + association_proxy = record.send(:association_proxy, join_part.reflection.name) + association_proxy.target = association association_proxy.send(:set_inverse_instance, association) end end |