diff options
author | gbuesing <gbuesing@gmail.com> | 2008-05-08 20:31:54 -0500 |
---|---|---|
committer | gbuesing <gbuesing@gmail.com> | 2008-05-08 20:31:54 -0500 |
commit | 328fada610aa9128386bc4b372d3e0b68aede945 (patch) | |
tree | 2499b812446d42b2a15de1b5f152771c27db445d /activerecord/test | |
parent | eb5b93be74ed3eca925c1ab9bd4739919ae39a41 (diff) | |
download | rails-328fada610aa9128386bc4b372d3e0b68aede945.tar.gz rails-328fada610aa9128386bc4b372d3e0b68aede945.tar.bz2 rails-328fada610aa9128386bc4b372d3e0b68aede945.zip |
ActiveRecord time zone aware attributes: blank string is treated as nil when assigned to writer
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/cases/attribute_methods_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index ab9abf27f9..c336fd9afb 100755 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -186,6 +186,14 @@ class AttributeMethodsTest < ActiveRecord::TestCase end end end + + def test_setting_time_zone_aware_attribute_to_blank_string_returns_nil + in_time_zone "Pacific Time (US & Canada)" do + record = @target.new + record.written_on = ' ' + assert_nil record.written_on + end + end def test_setting_time_zone_aware_attribute_interprets_time_zone_unaware_string_in_time_zone time_string = 'Tue Jan 01 00:00:00 2008' |