aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-09-06 12:59:11 +0100
committerJon Leighton <j@jonathanleighton.com>2011-09-06 12:59:11 +0100
commit9f3e732e65dfa978e036a3b0df3578b2d6a6510a (patch)
tree3c2511091fc2b1214161e959481502eba2d0da1d
parent77ff1ce541f96a7703a4083454166f0ee82fd812 (diff)
downloadrails-9f3e732e65dfa978e036a3b0df3578b2d6a6510a.tar.gz
rails-9f3e732e65dfa978e036a3b0df3578b2d6a6510a.tar.bz2
rails-9f3e732e65dfa978e036a3b0df3578b2d6a6510a.zip
Make the logic easier to read
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/quoting.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
index 3de850ec9e..f93c7cd74a 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
@@ -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