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/inheritance_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/inheritance_test.rb')
-rw-r--r-- | activerecord/test/cases/inheritance_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/inheritance_test.rb b/activerecord/test/cases/inheritance_test.rb index 629167e9ed..01e4878c3f 100644 --- a/activerecord/test/cases/inheritance_test.rb +++ b/activerecord/test/cases/inheritance_test.rb @@ -471,9 +471,9 @@ class InheritanceTest < ActiveRecord::TestCase end def test_eager_load_belongs_to_primary_key_quoting - con = Account.connection + c = Account.connection bind_param = Arel::Nodes::BindParam.new(nil) - assert_sql(/#{con.quote_table_name('companies')}\.#{con.quote_column_name('id')} = (?:#{Regexp.quote(bind_param.to_sql)}|1)/) do + assert_sql(/#{Regexp.escape(c.quote_table_name("companies.id"))} = (?:#{Regexp.escape(bind_param.to_sql)}|1)/i) do Account.all.merge!(includes: :firm).find(1) end end |