Skip to content
This repository
Browse code

Make the logic easier to read

  • Loading branch information...
commit 9f3e732e65dfa978e036a3b0df3578b2d6a6510a 1 parent 77ff1ce
Jon Leighton jonleighton authored
11 activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
@@ -102,10 +102,13 @@ def quoted_false
102 102 def quoted_date(value)
103 103 if value.acts_like?(:time)
104 104 zone_conversion_method = ActiveRecord::Base.default_timezone == :utc ? :getutc : :getlocal
105   - value.respond_to?(zone_conversion_method) ? value.send(zone_conversion_method) : value
106   - else
107   - value
108   - end.to_s(:db)
  105 +
  106 + if value.respond_to?(zone_conversion_method)
  107 + value = value.send(zone_conversion_method)
  108 + end
  109 + end
  110 +
  111 + value.to_s(:db)
109 112 end
110 113 end
111 114 end

0 comments on commit 9f3e732

Please sign in to comment.
Something went wrong with that request. Please try again.