From 76435d4c9de74f9d19eda8aa54141ac3bad16364 Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Tue, 14 Nov 2023 11:50:56 +0000 Subject: [PATCH] Remove constants and cleanup --- .../connection_adapters/sqlserver/utils.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/active_record/connection_adapters/sqlserver/utils.rb b/lib/active_record/connection_adapters/sqlserver/utils.rb index d5f87097e..002847919 100644 --- a/lib/active_record/connection_adapters/sqlserver/utils.rb +++ b/lib/active_record/connection_adapters/sqlserver/utils.rb @@ -6,13 +6,9 @@ module ActiveRecord module ConnectionAdapters module SQLServer module Utils - QUOTED_STRING_PREFIX = "N" - # Value object to return identifiers from SQL Server names http://bit.ly/1CZ3EiL # Inspired from Rails PostgreSQL::Name adapter object in their own Utils. - # class Name - SEPARATOR = "." UNQUOTED_SCANNER = /\]?\./ QUOTED_SCANNER = /\A\[.*?\]\./ QUOTED_CHECKER = /\A\[/ @@ -42,7 +38,7 @@ def server_quoted end def fully_qualified_database_quoted - [server_quoted, database_quoted].compact.join(SEPARATOR) + [server_quoted, database_quoted].compact.join('.') end def fully_qualified? @@ -69,7 +65,7 @@ def to_s end def quoted - parts.map { |p| quote(p) if p }.join SEPARATOR + parts.map { |p| quote(p) if p }.join('.') end def quoted_raw @@ -132,7 +128,7 @@ def parts extend self def quote_string(s) - s.to_s.gsub /\'/, "''" + s.to_s.gsub(/\'/, "''") end def quote_string_single(s) @@ -140,7 +136,7 @@ def quote_string_single(s) end def quote_string_single_national(s) - "#{QUOTED_STRING_PREFIX}'#{quote_string(s)}'" + "N'#{quote_string(s)}'" end def quoted_raw(name)