Skip to content

Commit f03e4c6

Browse files
committed
Update utils.rb
1 parent 6bc6475 commit f03e4c6

File tree

1 file changed

+3
-3
lines changed
  • lib/active_record/connection_adapters/sqlserver

1 file changed

+3
-3
lines changed

lib/active_record/connection_adapters/sqlserver/utils.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def parse_raw_name
109109
end
110110

111111
def quote(part)
112-
(/\A\[.*\]\z/.match?(part)) ? part : "[#{part.to_s.gsub("]", "]]")}]"
112+
/\A\[.*\]\z/.match?(part) ? part : "[#{part.to_s.gsub("]", "]]")}]"
113113
end
114114

115115
def unquote(part)
@@ -126,7 +126,7 @@ def unquote(part)
126126
extend self
127127

128128
def quote_string(s)
129-
s.to_s.gsub('\\'', "''")
129+
s.to_s.gsub("'", "''")
130130
end
131131

132132
def quote_string_single(s)
@@ -142,7 +142,7 @@ def quoted_raw(name)
142142
end
143143

144144
def unquote_string(s)
145-
s.to_s.gsub('\\'\\'', "'")
145+
s.to_s.gsub("''", "'")
146146
end
147147

148148
def extract_identifiers(name)

0 commit comments

Comments
 (0)