File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
lib/active_record/connection_adapters/sqlserver Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11
22* 3.1.1 *
33
4+ * Provide a method to override for the quoted string prefix. Not a config because trumping this method will
5+ have drastically bad results. Fixes #124
6+
47* Allow :limit/:offset to be used with fully qualified table and column in :select.
58
69
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ module Sqlserver
44 module Quoting
55
66 QUOTED_TRUE , QUOTED_FALSE = '1' , '0'
7+ QUOTED_STRING_PREFIX = 'N'
78
89 def quote ( value , column = nil )
910 case value
@@ -13,7 +14,7 @@ def quote(value, column = nil)
1314 elsif column && column . type == :binary
1415 column . class . string_to_binary ( value )
1516 elsif value . is_utf8? || ( column && column . type == :string )
16- "N '#{ quote_string ( value ) } '"
17+ "#{ quoted_string_prefix } '#{ quote_string ( value ) } '"
1718 else
1819 super
1920 end
@@ -31,7 +32,11 @@ def quote(value, column = nil)
3132 super
3233 end
3334 end
34-
35+
36+ def quoted_string_prefix
37+ QUOTED_STRING_PREFIX
38+ end
39+
3540 def quote_string ( string )
3641 string . to_s . gsub ( /\' / , "''" )
3742 end
You can’t perform that action at this time.
0 commit comments