mirror of
https://github.com/github/rails.git
synced 2026-01-10 07:07:54 -05:00
Make the logic easier to read
This commit is contained in:
@@ -102,10 +102,13 @@ module ActiveRecord
|
||||
def quoted_date(value)
|
||||
if value.acts_like?(:time)
|
||||
zone_conversion_method = ActiveRecord::Base.default_timezone == :utc ? :getutc : :getlocal
|
||||
value.respond_to?(zone_conversion_method) ? value.send(zone_conversion_method) : value
|
||||
else
|
||||
value
|
||||
end.to_s(:db)
|
||||
|
||||
if value.respond_to?(zone_conversion_method)
|
||||
value = value.send(zone_conversion_method)
|
||||
end
|
||||
end
|
||||
|
||||
value.to_s(:db)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user