Ticket #8049: quoting.diff
| File quoting.diff, 1.7 kB (added by FooBarWidget, 1 year ago) |
|---|
-
activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
old new 11 11 when String, ActiveSupport::Multibyte::Chars 12 12 value = value.to_s 13 13 if column && column.type == :binary && column.class.respond_to?(:string_to_binary) 14 " '#{quote_string(column.class.string_to_binary(value))}'" # ' (for ruby-mode)14 "#{quoted_string_prefix}'#{quote_string(column.class.string_to_binary(value))}'" # ' (for ruby-mode) 15 15 elsif column && [:integer, :float].include?(column.type) 16 16 value = column.type == :integer ? value.to_i : value.to_f 17 17 value.to_s 18 18 else 19 " '#{quote_string(value)}'" # ' (for ruby-mode)19 "#{quoted_string_prefix}'#{quote_string(value)}'" # ' (for ruby-mode) 20 20 end 21 21 when NilClass then "NULL" 22 22 when TrueClass then (column && column.type == :integer ? '1' : quoted_true) … … 28 28 if value.acts_like?(:date) || value.acts_like?(:time) 29 29 "'#{quoted_date(value)}'" 30 30 else 31 " '#{quote_string(value.to_yaml)}'"31 "#{quoted_string_prefix}'#{quote_string(value.to_yaml)}'" 32 32 end 33 33 end 34 34 end … … 56 56 def quoted_date(value) 57 57 value.to_s(:db) 58 58 end 59 60 def quoted_string_prefix 61 '' 62 end 59 63 end 60 64 end 61 65 end