diff options
author | brainopia <brainopia@evilmartians.com> | 2012-08-17 17:50:12 +0400 |
---|---|---|
committer | brainopia <brainopia@evilmartians.com> | 2012-08-18 18:11:28 +0400 |
commit | c9c5566acef049f924ade61da2247a5c9456eba0 (patch) | |
tree | ce900e697da966f27aa2a43a12730554cab5f556 /activerecord/lib/active_record/associations | |
parent | 9f8852128f2ad968e15b53728bb5c9fb3ba52e3b (diff) | |
download | rails-c9c5566acef049f924ade61da2247a5c9456eba0.tar.gz rails-c9c5566acef049f924ade61da2247a5c9456eba0.tar.bz2 rails-c9c5566acef049f924ade61da2247a5c9456eba0.zip |
Use inversed parent for first and last child of has_many association
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index a84eda1d3b..b15df4f308 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -574,7 +574,7 @@ module ActiveRecord args.shift if args.first.is_a?(Hash) && args.first.empty? collection = fetch_first_or_last_using_find?(args) ? scope : load_target - collection.send(type, *args) + collection.send(type, *args).tap {|it| set_inverse_instance it } end end end |