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/test | |
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/test')
-rw-r--r-- | activerecord/test/cases/scoping/relation_scoping_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/scoping/relation_scoping_test.rb b/activerecord/test/cases/scoping/relation_scoping_test.rb index c15d57460b..ef46fd5d9a 100644 --- a/activerecord/test/cases/scoping/relation_scoping_test.rb +++ b/activerecord/test/cases/scoping/relation_scoping_test.rb @@ -228,6 +228,13 @@ class RelationScopingTest < ActiveRecord::TestCase assert SpecialComment.all.any? end end + + def test_circular_joins_with_current_scope_does_not_crash + posts = Post.joins(comments: :post).scoping do + Post.current_scope.first(10) + end + assert_equal posts, Post.joins(comments: :post).first(10) + end end class NestedRelationScopingTest < ActiveRecord::TestCase |