diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2019-02-23 14:33:23 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-23 14:33:23 +0900 |
commit | f3641b187e93808ceadd1e0d4b45ad7a484be4d9 (patch) | |
tree | 810ddd35b2fdef97a1f615a80cc26f26c089e83e /activerecord/test | |
parent | a796de1bd644b54e2c27577319c262af0de56e8f (diff) | |
parent | 619ae03f60c00e0870cd391b3252091b005fe948 (diff) | |
download | rails-f3641b187e93808ceadd1e0d4b45ad7a484be4d9.tar.gz rails-f3641b187e93808ceadd1e0d4b45ad7a484be4d9.tar.bz2 rails-f3641b187e93808ceadd1e0d4b45ad7a484be4d9.zip |
Merge pull request #35375 from y-yagi/fix_test_select_with_subquery_in_from_uses_original_table_name
Make `test_select_with_subquery_in_from_uses_original_table_name` work with old SQLite3
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index dca7493aee..b28e2910bb 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -207,14 +207,9 @@ class RelationTest < ActiveRecord::TestCase end def test_select_with_subquery_in_from_uses_original_table_name - if current_adapter?(:SQLite3Adapter) && ENV["CI"] - skip <<~MSG - https://travis-ci.org/rails/rails/jobs/496726410#L1198-L1208 - https://buildkite.com/rails/rails/builds/58981#2423c707-7c56-4639-a76e-8db4fd1e5cf3/102-111 - MSG - end relation = Comment.joins(:post).select(:id).order(:id) - subquery = Comment.from(Comment.all, Comment.quoted_table_name).joins(:post).select(:id).order(:id) + # Avoid subquery flattening by adding distinct to work with SQLite < 3.20.0. + subquery = Comment.from(Comment.all.distinct, Comment.quoted_table_name).joins(:post).select(:id).order(:id) assert_equal relation.map(&:id), subquery.map(&:id) end |