instance method
_quote
Ruby on Rails 4.2.9
Since v4.2.9 Last seen in v6.1.7.10 PrivateSignature
_quote(value)
No documentation comment.
Parameters
-
valuereq
Source
# File activerecord/lib/active_record/connection_adapters/abstract/quoting.rb, line 100
def _quote(value)
case value
when String, ActiveSupport::Multibyte::Chars, Type::Binary::Data
"'#{quote_string(value.to_s)}'"
when true then quoted_true
when false then quoted_false
when nil then "NULL"
# BigDecimals need to be put in a non-normalized form and quoted.
when BigDecimal then value.to_s('F')
when Numeric, ActiveSupport::Duration then value.to_s
when Date, Time then "'#{quoted_date(value)}'"
when Symbol then "'#{quote_string(value.to_s)}'"
when Class then "'#{value}'"
else
"'#{quote_string(YAML.dump(value))}'"
end
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/quoting.rb line 100
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::Quoting