diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-07-27 20:31:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-27 20:31:38 -0400 |
commit | a64d9835f11ea7919fae825bceb91e08a1480766 (patch) | |
tree | 54afe354300e7842a96e413e77045b6313315eec /activerecord/test | |
parent | 2a095142fb2f3300c841cf3a15100581635f4a35 (diff) | |
parent | 28c29973aa143735333f658910b882cf265db692 (diff) | |
download | rails-a64d9835f11ea7919fae825bceb91e08a1480766.tar.gz rails-a64d9835f11ea7919fae825bceb91e08a1480766.tar.bz2 rails-a64d9835f11ea7919fae825bceb91e08a1480766.zip |
Merge pull request #25702 from k0kubun/joins-circular-reference
Remove circular join references in join_dependency
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 |