aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attribute_methods_test.rb
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2011-12-19 23:41:09 +0300
committerSergey Nartimov <just.lest@gmail.com>2011-12-19 23:41:09 +0300
commite2d19d60182b017bb092a018564d329c4f52b6a3 (patch)
tree16742dc8ae5006eca12e716a3892fb338a5a07f8 /activerecord/test/cases/attribute_methods_test.rb
parent3c1884e7dd77d8f33f86e96fd7e4190c4a301133 (diff)
downloadrails-e2d19d60182b017bb092a018564d329c4f52b6a3.tar.gz
rails-e2d19d60182b017bb092a018564d329c4f52b6a3.tar.bz2
rails-e2d19d60182b017bb092a018564d329c4f52b6a3.zip
handle not only strings in date type cast
Diffstat (limited to 'activerecord/test/cases/attribute_methods_test.rb')
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb8
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)