From fab487228c880c3b85b06de1770679d45f7a7dfa Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Wed, 17 Sep 2014 12:37:00 -0600 Subject: Allow YAML serialization when using TZ aware attributes --- activerecord/test/cases/attribute_methods_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index b4917e727a..153f870e3d 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -681,6 +681,14 @@ class AttributeMethodsTest < ActiveRecord::TestCase end end + def test_yaml_dumping_record_with_time_zone_aware_attribute + in_time_zone "Pacific Time (US & Canada)" do + record = Topic.new(id: 1) + record.written_on = "Jan 01 00:00:00 2014" + assert_equal record, YAML.load(YAML.dump(record)) + end + end + def test_setting_time_zone_conversion_for_attributes_should_write_value_on_class_variable Topic.skip_time_zone_conversion_for_attributes = [:field_a] Minimalistic.skip_time_zone_conversion_for_attributes = [:field_b] -- cgit v1.2.3