aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAidan Haran <aidanharan@yahoo.com>2018-10-04 11:56:00 +0100
committerAidan Haran <aidanharan@yahoo.com>2018-10-04 11:56:00 +0100
commit50684d15c6546d3050d93896612edd9c5a0fca62 (patch)
treec319066463cf4d6375101defe1df1d8ebee654c0 /activerecord
parent54652d886ad1c9ffca36c6f2baadcdd6135ef4dd (diff)
downloadrails-50684d15c6546d3050d93896612edd9c5a0fca62.tar.gz
rails-50684d15c6546d3050d93896612edd9c5a0fca62.tar.bz2
rails-50684d15c6546d3050d93896612edd9c5a0fca62.zip
Escape table name so that it can be used in regular expression
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/relation_test.rb2
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