diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-10-04 23:05:47 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-04 23:05:47 +0900 |
commit | 414c70e072466ebe40e7c46795f27c48cba8d717 (patch) | |
tree | c319066463cf4d6375101defe1df1d8ebee654c0 /activerecord/test | |
parent | 54652d886ad1c9ffca36c6f2baadcdd6135ef4dd (diff) | |
parent | 50684d15c6546d3050d93896612edd9c5a0fca62 (diff) | |
download | rails-414c70e072466ebe40e7c46795f27c48cba8d717.tar.gz rails-414c70e072466ebe40e7c46795f27c48cba8d717.tar.bz2 rails-414c70e072466ebe40e7c46795f27c48cba8d717.zip |
Merge pull request #34073 from aidanharan/activerecord-regex-escape-table-name
Escape table name so that it can be used in regular expression
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relation_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb index fbeb617b29..68161f6a84 100644 --- a/activerecord/test/cases/relation_test.rb +++ b/activerecord/test/cases/relation_test.rb @@ -232,7 +232,7 @@ module ActiveRecord assert_equal 3, nb_inner_join, "Wrong amount of INNER JOIN in query" # using `\W` as the column separator - assert queries.any? { |sql| %r[INNER\s+JOIN\s+#{Author.quoted_table_name}\s+\Wauthors_categorizations\W]i.match?(sql) }, "Should be aliasing the child INNER JOINs in query" + assert queries.any? { |sql| %r[INNER\s+JOIN\s+#{Regexp.escape(Author.quoted_table_name)}\s+\Wauthors_categorizations\W]i.match?(sql) }, "Should be aliasing the child INNER JOINs in query" end def test_relation_with_merged_joins_aliased_works |