From 79f71d35e957772df7454212b3f235423064832a Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Sun, 25 Jan 2015 16:13:27 -0700 Subject: Don't access the where values hash directly in through associations See 4d7a62293e148604045a5f78a9d4312e79e90d13 for the reasoning --- .../lib/active_record/associations/preloader/through_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations/preloader/through_association.rb') diff --git a/activerecord/lib/active_record/associations/preloader/through_association.rb b/activerecord/lib/active_record/associations/preloader/through_association.rb index 12bf3ef138..816a807f55 100644 --- a/activerecord/lib/active_record/associations/preloader/through_association.rb +++ b/activerecord/lib/active_record/associations/preloader/through_association.rb @@ -80,7 +80,7 @@ module ActiveRecord else unless reflection_scope.where_values.empty? scope.includes_values = Array(reflection_scope.values[:includes] || options[:source]) - scope.where_values = reflection_scope.values[:where] + scope.where_values = reflection_scope.where_values scope.bind_values = reflection_scope.bind_values end -- cgit v1.2.3 From 320600c773a16418fe37eccea2eb1082f58062f7 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Sun, 25 Jan 2015 16:44:04 -0700 Subject: Remove all references to `where_values` in association code --- .../lib/active_record/associations/preloader/through_association.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'activerecord/lib/active_record/associations/preloader/through_association.rb') diff --git a/activerecord/lib/active_record/associations/preloader/through_association.rb b/activerecord/lib/active_record/associations/preloader/through_association.rb index 816a807f55..56aa23b173 100644 --- a/activerecord/lib/active_record/associations/preloader/through_association.rb +++ b/activerecord/lib/active_record/associations/preloader/through_association.rb @@ -78,10 +78,9 @@ module ActiveRecord if options[:source_type] scope.where! reflection.foreign_type => options[:source_type] else - unless reflection_scope.where_values.empty? + unless reflection_scope.where_clause.empty? scope.includes_values = Array(reflection_scope.values[:includes] || options[:source]) - scope.where_values = reflection_scope.where_values - scope.bind_values = reflection_scope.bind_values + scope.where_clause = reflection_scope.where_clause end scope.references! reflection_scope.values[:references] -- cgit v1.2.3