diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2016-07-06 00:30:50 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2016-07-28 03:25:20 +0900 |
commit | 28c29973aa143735333f658910b882cf265db692 (patch) | |
tree | 56f2197488d05fb812ecb0498dd0a3cf5be2e974 /activerecord/lib | |
parent | 7e6996a1b36cdf8158a27eeaa7e6d97a05994707 (diff) | |
download | rails-28c29973aa143735333f658910b882cf265db692.tar.gz rails-28c29973aa143735333f658910b882cf265db692.tar.bz2 rails-28c29973aa143735333f658910b882cf265db692.zip |
Remove circular join references in join_dependency
Fixes #25653.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_association.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb index c5fbe0d1d1..bdf77009eb 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -56,7 +56,9 @@ module ActiveRecord klass_scope = if klass.current_scope - klass.current_scope.clone + klass.current_scope.clone.tap { |scope| + scope.joins_values = [] + } else relation = ActiveRecord::Relation.create( klass, |