method
quote
v1.1.6 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::SQLServerAdapter
quote(value, column = nil)public
No documentation available.
# File activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb, line 330
def quote(value, column = nil)
case value
when String
if column && column.type == :binary && column.class.respond_to?(:string_to_binary)
"'#{quote_string(column.class.string_to_binary(value))}'"
else
"'#{quote_string(value)}'"
end
when NilClass then "NULL"
when TrueClass then '1'
when FalseClass then '0'
when Float, Fixnum, Bignum then value.to_s
when Date then "'#{value.to_s}'"
when Time, DateTime then "'#{value.strftime("%Y-%m-%d %H:%M:%S")}'"
else "'#{quote_string(value.to_yaml)}'"
end
end