diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-20 09:42:17 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-20 09:42:17 -0800 |
commit | 3ef20aa62c11b2fbb709fcbf7aaa2fc982d27d5e (patch) | |
tree | 1fde65288c83ca1dfe6626c7e6aa8966d5476149 /activerecord/test/cases | |
parent | 7ba28d434ceb0401f937e77f19d1c31e2a43f1ac (diff) | |
parent | e2d19d60182b017bb092a018564d329c4f52b6a3 (diff) | |
download | rails-3ef20aa62c11b2fbb709fcbf7aaa2fc982d27d5e.tar.gz rails-3ef20aa62c11b2fbb709fcbf7aaa2fc982d27d5e.tar.bz2 rails-3ef20aa62c11b2fbb709fcbf7aaa2fc982d27d5e.zip |
Merge pull request #4035 from lest/date-type-cast
handle not only strings in date type cast
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | 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 39e58559b0..5e9f8028e9 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -518,6 +518,14 @@ class AttributeMethodsTest < ActiveRecord::TestCase end end + def test_write_time_to_date_attributes + in_time_zone "Pacific Time (US & Canada)" do + record = @target.new + record.last_read = Time.utc(2010, 1, 1, 10) + assert_equal Date.civil(2010, 1, 1), record.last_read + end + end + def test_time_attributes_are_retrieved_in_current_time_zone in_time_zone "Pacific Time (US & Canada)" do utc_time = Time.utc(2008, 1, 1) |