diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-07-08 09:26:03 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-07-08 09:32:30 +0900 |
commit | 7d699dad334996838dd529e4b75e1648692d56f8 (patch) | |
tree | 2f492b312c2e6c3e0f720b46b02537f892171e36 /activerecord/test/cases/batches_test.rb | |
parent | 74ef67b16de67d2ae2f996e50a18a93aebf68fe6 (diff) | |
download | rails-7d699dad334996838dd529e4b75e1648692d56f8.tar.gz rails-7d699dad334996838dd529e4b75e1648692d56f8.tar.bz2 rails-7d699dad334996838dd529e4b75e1648692d56f8.zip |
Should `Regexp.escape` quoted table name in regex
It is for agnostic test case, since quoted table name may include `.`
for all adapters, and `[` / `]` for sqlserver adapter.
Diffstat (limited to 'activerecord/test/cases/batches_test.rb')
-rw-r--r-- | activerecord/test/cases/batches_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/batches_test.rb b/activerecord/test/cases/batches_test.rb index cf6e280898..0d0bf39f79 100644 --- a/activerecord/test/cases/batches_test.rb +++ b/activerecord/test/cases/batches_test.rb @@ -146,7 +146,7 @@ class EachTest < ActiveRecord::TestCase def test_find_in_batches_should_quote_batch_order c = Post.connection - assert_sql(/ORDER BY #{c.quote_table_name('posts')}\.#{c.quote_column_name('id')}/) do + assert_sql(/ORDER BY #{Regexp.escape(c.quote_table_name("posts.id"))}/i) do Post.find_in_batches(batch_size: 1) do |batch| assert_kind_of Array, batch assert_kind_of Post, batch.first |