From 1b7aa62b184c4410c99208f71b59bbac5c5f03be Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Thu, 24 Apr 2014 12:34:33 -0500 Subject: reset `@arel` when modifying a Relation in place. /cc @tenderlove --- .../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 70e97432e4..1fed7f74e7 100644 --- a/activerecord/lib/active_record/associations/preloader/through_association.rb +++ b/activerecord/lib/active_record/associations/preloader/through_association.rb @@ -84,7 +84,7 @@ module ActiveRecord end scope.references! reflection_scope.values[:references] - scope.order! reflection_scope.values[:order] if scope.eager_loading? + scope = scope.order reflection_scope.values[:order] if scope.eager_loading? end scope -- cgit v1.2.3