aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/preloader
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-12-29 14:26:38 +0000
committerJon Leighton <j@jonathanleighton.com>2011-12-29 14:27:33 +0000
commitc99d507fccca2e9e4d12e49b4387e007c5481ae9 (patch)
tree269b10745091c0c0e3941ab756cec0130cbc11bd /activerecord/lib/active_record/associations/preloader
parent0b8b68209ded58e40cc18f3fef2f2c38e3730bb8 (diff)
downloadrails-c99d507fccca2e9e4d12e49b4387e007c5481ae9.tar.gz
rails-c99d507fccca2e9e4d12e49b4387e007c5481ae9.tar.bz2
rails-c99d507fccca2e9e4d12e49b4387e007c5481ae9.zip
Deprecate implicit eager loading. Closes #950.
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader')
-rw-r--r--activerecord/lib/active_record/associations/preloader/association.rb1
-rw-r--r--activerecord/lib/active_record/associations/preloader/through_association.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/preloader/association.rb b/activerecord/lib/active_record/associations/preloader/association.rb
index 779f8164cc..298decb0f1 100644
--- a/activerecord/lib/active_record/associations/preloader/association.rb
+++ b/activerecord/lib/active_record/associations/preloader/association.rb
@@ -100,6 +100,7 @@ module ActiveRecord
scope = scope.select(preload_options[:select] || options[:select] || table[Arel.star])
scope = scope.includes(preload_options[:include] || options[:include])
+ scope = scope.eager_load(preload_options[:eager_load] || options[:eager_load])
if options[:as]
scope = scope.where(
diff --git a/activerecord/lib/active_record/associations/preloader/through_association.rb b/activerecord/lib/active_record/associations/preloader/through_association.rb
index ad6374d09a..97898c53ae 100644
--- a/activerecord/lib/active_record/associations/preloader/through_association.rb
+++ b/activerecord/lib/active_record/associations/preloader/through_association.rb
@@ -53,6 +53,7 @@ module ActiveRecord
else
if options[:conditions]
through_options[:include] = options[:include] || options[:source]
+ through_options[:eager_load] = options[:eager_load] || options[:source]
through_options[:conditions] = options[:conditions]
end