Permalink
Browse files

Make the logic easier to read

  • Loading branch information...
1 parent 77ff1ce commit 9f3e732e65dfa978e036a3b0df3578b2d6a6510a @jonleighton jonleighton committed Sep 6, 2011
Showing with 7 additions and 4 deletions.
  1. +7 −4 activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
View
11 activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
@@ -102,10 +102,13 @@ def quoted_false
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

0 comments on commit 9f3e732

Please sign in to comment.