Changeset 9081
- Timestamp:
- 03/23/08 04:44:50 (7 months ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/time_with_zone.rb (modified) (1 diff)
- trunk/activesupport/test/core_ext/time_with_zone_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r9079 r9081 1 1 *SVN* 2 3 * Ensure that TimeWithZone#to_yaml works when passed a YAML::Emitter. [rick] 2 4 3 5 * Ensure correct TimeWithZone#to_date [Geoff Buesing] trunk/activesupport/lib/active_support/time_with_zone.rb
r9079 r9081 81 81 82 82 def to_yaml(options = {}) 83 time.to_yaml(options).gsub('Z', formatted_offset(true, 'Z')) 83 if options.kind_of?(YAML::Emitter) 84 utc.to_yaml(options) 85 else 86 time.to_yaml(options).gsub('Z', formatted_offset(true, 'Z')) 87 end 84 88 end 85 89 trunk/activesupport/test/core_ext/time_with_zone_test.rb
r9079 r9081 104 104 silence_warnings do # silence warnings raised by tzinfo gem 105 105 assert_equal "--- 1999-12-31 19:00:00 -05:00\n", @twz.to_yaml 106 end 107 end 108 109 def test_ruby_to_yaml 110 silence_warnings do 111 assert_equal "--- \n:twz: 2000-01-01 00:00:00 Z\n", {:twz => @twz}.to_yaml 106 112 end 107 113 end