diff --git a/lib/active_record/connection_adapters/sqlserver/core_ext/query_methods.rb b/lib/active_record/connection_adapters/sqlserver/core_ext/query_methods.rb new file mode 100644 index 000000000..b9f4529dd --- /dev/null +++ b/lib/active_record/connection_adapters/sqlserver/core_ext/query_methods.rb @@ -0,0 +1,26 @@ +require 'active_record/relation' +require 'active_record/version' + +module ActiveRecord + module ConnectionAdapters + module SQLServer + module CoreExt + module QueryMethods + + private + + # Copy of original from Rails master. This patch can be removed when adapter supports Rails 6. + def table_name_matches?(from) + table_name = Regexp.escape(table.name) + quoted_table_name = Regexp.escape(connection.quote_table_name(table.name)) + /(?:\A|(?