diff options
Diffstat (limited to 'activesupport/lib/active_support/time_with_zone.rb')
-rw-r--r-- | activesupport/lib/active_support/time_with_zone.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 7b9b121a17..56c4f40f32 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -80,7 +80,11 @@ module ActiveSupport end def to_yaml(options = {}) - time.to_yaml(options).gsub('Z', formatted_offset(true, 'Z')) + if options.kind_of?(YAML::Emitter) + utc.to_yaml(options) + else + time.to_yaml(options).gsub('Z', formatted_offset(true, 'Z')) + end end def httpdate |