diff options
author | Mike Dvorkin <mike@dvorkin.net> | 2010-12-08 20:39:46 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-12-09 09:01:49 +0100 |
commit | f572a02b94ce85bb8db64e838aa159cf3ef4b1fa (patch) | |
tree | fd3151aaa4e99a442a7055ec463a5f30bc73989d /activemodel/lib/active_model | |
parent | 07b0e59988beb1b29bdfadd02f0d015eae9191cf (diff) | |
download | rails-f572a02b94ce85bb8db64e838aa159cf3ef4b1fa.tar.gz rails-f572a02b94ce85bb8db64e838aa159cf3ef4b1fa.tar.bz2 rails-f572a02b94ce85bb8db64e838aa159cf3ef4b1fa.zip |
Take into account current time zone when serializing datetime values [#6096 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/serializers/xml.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/serializers/xml.rb b/activemodel/lib/active_model/serializers/xml.rb index 26a134568c..b897baa614 100644 --- a/activemodel/lib/active_model/serializers/xml.rb +++ b/activemodel/lib/active_model/serializers/xml.rb @@ -17,6 +17,7 @@ module ActiveModel def initialize(name, serializable, raw_value=nil) @name, @serializable = name, serializable + raw_value = raw_value.in_time_zone if raw_value.respond_to?(:in_time_zone) @value = raw_value || @serializable.send(name) @type = compute_type end |