mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Escape table name so that it can be used in regular expression
This commit is contained in:
parent
54652d886a
commit
50684d15c6
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue