1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge the redundant when Symbol case to the when String, ...

This commit is contained in:
Ryuta Kamizono 2019-01-04 08:05:17 +09:00
parent e9aa0c5c72
commit 7a4e20e0cd

View file

@ -159,7 +159,7 @@ module ActiveRecord
def _quote(value)
case value
when String, ActiveSupport::Multibyte::Chars
when String, Symbol, ActiveSupport::Multibyte::Chars
"'#{quote_string(value.to_s)}'"
when true then quoted_true
when false then quoted_false
@ -170,7 +170,6 @@ module ActiveRecord
when Type::Binary::Data then quoted_binary(value)
when Type::Time::Value then "'#{quoted_time(value)}'"
when Date, Time then "'#{quoted_date(value)}'"
when Symbol then "'#{quote_string(value.to_s)}'"
when Class then "'#{value}'"
else raise TypeError, "can't quote #{value.class.name}"
end