From 86390c3bf30dd61f3bac047e0887b74ff422c02f Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Thu, 7 Jul 2011 01:07:20 +0100 Subject: Don't construct association scope in initializer. This yields a big performance gain for cases where the association is never used to load the target, for example with preloading. Related: #1873. --- activerecord/lib/active_record/autosave_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/autosave_association.rb') diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index 036d514a03..085fdba639 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -347,7 +347,7 @@ module ActiveRecord end # reconstruct the scope now that we know the owner's id - association.send(:construct_scope) if association.respond_to?(:construct_scope) + association.send(:reset_scope) if association.respond_to?(:reset_scope) end end -- cgit v1.2.3