aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2013-06-21 12:25:49 -0700
committerJon Leighton <j@jonathanleighton.com>2013-06-21 12:25:49 -0700
commitecdce2e105280fcb367be8a809f8ff24a719a4f8 (patch)
treedfd8289327ad2cbd307a7366f2f4965d5b221fdd /activerecord/lib
parentcbc2e7987e71ff34149acaf1f9f3205f30b67174 (diff)
parent82882d4162c534e9aeef629cbbd7b5f84f45ee12 (diff)
downloadrails-ecdce2e105280fcb367be8a809f8ff24a719a4f8.tar.gz
rails-ecdce2e105280fcb367be8a809f8ff24a719a4f8.tar.bz2
rails-ecdce2e105280fcb367be8a809f8ff24a719a4f8.zip
Merge pull request #11051 from neerajdotname/10509f
do not load all child records for inverse case
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb2
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 efd7ecb97c..9833822f8f 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -81,7 +81,7 @@ module ActiveRecord
else
if options[:finder_sql]
find_by_scan(*args)
- elsif options[:inverse_of]
+ elsif options[:inverse_of] && loaded?
args = args.flatten
raise RecordNotFound, "Couldn't find #{scope.klass.name} without an ID" if args.blank?