aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-04 17:29:40 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-04 17:29:40 -0800
commit5c666779872e6702f4d826686eab09db37cba062 (patch)
tree6a213fe6fd04ae0921765dd3fbaa29c6d3e92640 /activesupport
parent7bd32e4d1d7b5ffe300ce667dd8daa17a2a9ad26 (diff)
downloadrails-5c666779872e6702f4d826686eab09db37cba062.tar.gz
rails-5c666779872e6702f4d826686eab09db37cba062.tar.bz2
rails-5c666779872e6702f4d826686eab09db37cba062.zip
make our yaml output consistent
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb6
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb2
2 files changed, 2 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 6a7da8266c..8137f8e17e 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -138,11 +138,7 @@ module ActiveSupport
end
def to_yaml(options = {})
- if options.kind_of?(YAML::Emitter)
- utc.to_yaml(options)
- else
- time.to_yaml(options).gsub('Z', formatted_offset(true, 'Z'))
- end
+ utc.to_yaml(options)
end
def httpdate
diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb
index 5579c27215..2b86da67fa 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -106,7 +106,7 @@ class TimeWithZoneTest < Test::Unit::TestCase
end
def test_to_yaml
- assert_equal "--- 1999-12-31 19:00:00 -05:00\n", @twz.to_yaml
+ assert_equal "--- 2000-01-01 00:00:00 Z\n", @twz.to_yaml
end
def test_ruby_to_yaml