diff options
author | Jay Levitt <jay@jay.fm> | 2011-11-30 18:12:24 -0500 |
---|---|---|
committer | Jay Levitt <jay@jay.fm> | 2011-11-30 18:12:24 -0500 |
commit | 24b8814db0fb3660db2e5bc7067759674b3e3f37 (patch) | |
tree | c45fd3716eb8174b5646e5cf860684e94d20990c /activerecord/lib/active_record/associations | |
parent | cbeeaa6ea000d7a6e6ae90de5b6dc756d15240ab (diff) | |
download | rails-24b8814db0fb3660db2e5bc7067759674b3e3f37.tar.gz rails-24b8814db0fb3660db2e5bc7067759674b3e3f37.tar.bz2 rails-24b8814db0fb3660db2e5bc7067759674b3e3f37.zip |
reintroduce patch from #726 to handle nested eager loading via associations
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 6c878f0f00..827b01c5ac 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -184,7 +184,7 @@ module ActiveRecord macro = join_part.reflection.macro if macro == :has_one - return if record.association_cache.key?(join_part.reflection.name) + return record.association(join_part.reflection.name).target if record.association_cache.key?(join_part.reflection.name) association = join_part.instantiate(row) unless row[join_part.aliased_primary_key].nil? set_target_and_inverse(join_part, association, record) else |