diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-01-15 03:19:23 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-01-15 03:19:54 +0900 |
commit | 282668cc81ba153ed83820a5f544fea6907b504d (patch) | |
tree | 85251aa1dec3ce6a4d5b669a5aff41620acc5903 /activerecord/test | |
parent | 7b4132f4a28d1c264a972b95bf86bf6230869a40 (diff) | |
parent | f3d69c005291591220875efc48f82ea3909c6625 (diff) | |
download | rails-282668cc81ba153ed83820a5f544fea6907b504d.tar.gz rails-282668cc81ba153ed83820a5f544fea6907b504d.tar.bz2 rails-282668cc81ba153ed83820a5f544fea6907b504d.zip |
Merge pull request #28313 from sandrew/master
Allow unscoping of left_outer_joins
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/scoping/default_scoping_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/scoping/default_scoping_test.rb b/activerecord/test/cases/scoping/default_scoping_test.rb index fdfeabaa3b..6ff0f93cf3 100644 --- a/activerecord/test/cases/scoping/default_scoping_test.rb +++ b/activerecord/test/cases/scoping/default_scoping_test.rb @@ -224,6 +224,18 @@ class DefaultScopingTest < ActiveRecord::TestCase assert_equal expected, received end + def test_unscope_left_outer_joins + expected = Developer.all.collect(&:name) + received = Developer.left_outer_joins(:projects).select(:id).unscope(:left_outer_joins, :select).collect(&:name) + assert_equal expected, received + end + + def test_unscope_left_joins + expected = Developer.all.collect(&:name) + received = Developer.left_joins(:projects).select(:id).unscope(:left_joins, :select).collect(&:name) + assert_equal expected, received + end + def test_unscope_includes expected = Developer.all.collect(&:name) received = Developer.includes(:projects).select(:id).unscope(:includes, :select).collect(&:name) |