We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 033f0ff commit ac7162fCopy full SHA for ac7162f
lib/active_record/connection_adapters/sqlserver/core_ext/query_methods.rb
@@ -9,9 +9,11 @@ module QueryMethods
9
10
private
11
12
- # Same as original except quoted table name is regex escapes.
+ # Copy of original from Rails master. This patch can be removed when adapter supports Rails 6.
13
def table_name_matches?(from)
14
- /(?:\A|(?<!FROM)\s)(?:\b#{table.name}\b|#{Regexp.escape(connection.quote_table_name(table.name))})(?!\.)/i.match?(from.to_s)
+ table_name = Regexp.escape(table.name)
15
+ quoted_table_name = Regexp.escape(connection.quote_table_name(table.name))
16
+ /(?:\A|(?<!FROM)\s)(?:\b#{table_name}\b|#{quoted_table_name})(?!\.)/i.match?(from.to_s)
17
end
18
19
0 commit comments