diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-30 14:05:11 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-30 14:05:11 -0600 |
commit | d2315d0c3b1ede89b7cce6a77c647285359243c5 (patch) | |
tree | 3e47122c3b73dc483fd6e873c96d62ea06ab68f9 /activerecord/test | |
parent | d52baa851480ca79d60333187cd0dab9338b7c5f (diff) | |
parent | d3411ad361bf1d02b1f9e1724c1298e7de3670ea (diff) | |
download | rails-d2315d0c3b1ede89b7cce6a77c647285359243c5.tar.gz rails-d2315d0c3b1ede89b7cce6a77c647285359243c5.tar.bz2 rails-d2315d0c3b1ede89b7cce6a77c647285359243c5.zip |
Merge pull request #22125 from k0kubun/left_joins
Alias left_joins to left_outer_joins
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/left_outer_join_association_test.rb | 5 | ||||
-rw-r--r-- | activerecord/test/cases/relation/mutation_test.rb | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/cases/associations/left_outer_join_association_test.rb b/activerecord/test/cases/associations/left_outer_join_association_test.rb index 4be9264f81..4af791b758 100644 --- a/activerecord/test/cases/associations/left_outer_join_association_test.rb +++ b/activerecord/test/cases/associations/left_outer_join_association_test.rb @@ -29,6 +29,11 @@ class LeftOuterJoinAssociationTest < ActiveRecord::TestCase assert_equal Author.count, Author.left_outer_joins(:posts).count end + def test_left_outer_join_by_left_joins + assert_not_equal Author.count, Author.joins(:posts).count + assert_equal Author.count, Author.left_joins(:posts).count + end + def test_construct_finder_sql_ignores_empty_left_outer_joins_hash queries = capture_sql { Author.left_outer_joins({}) } assert queries.none? { |sql| /LEFT OUTER JOIN/i =~ sql } diff --git a/activerecord/test/cases/relation/mutation_test.rb b/activerecord/test/cases/relation/mutation_test.rb index 88d2dd55ab..cc0034ffd1 100644 --- a/activerecord/test/cases/relation/mutation_test.rb +++ b/activerecord/test/cases/relation/mutation_test.rb @@ -28,7 +28,7 @@ module ActiveRecord @relation ||= Relation.new FakeKlass.new('posts'), Post.arel_table, Post.predicate_builder end - (Relation::MULTI_VALUE_METHODS - [:references, :extending, :order, :unscope, :select]).each do |method| + (Relation::MULTI_VALUE_METHODS - [:references, :extending, :order, :unscope, :select, :left_joins]).each do |method| test "##{method}!" do assert relation.public_send("#{method}!", :foo).equal?(relation) assert_equal [:foo], relation.public_send("#{method}_values") |