diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-05 06:26:53 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-05 06:26:53 -0700 |
commit | 91183baa6d54428da7ea466f0a854de2e631dd64 (patch) | |
tree | 305e673886c4c629757eee8f8ebf1783cf54bff4 /activerecord/test | |
parent | 9e0a14f5e2baa7190a9679007b8abad800e48fff (diff) | |
parent | acf583a5e00be0fb684f73ad51cdad0237c981b2 (diff) | |
download | rails-91183baa6d54428da7ea466f0a854de2e631dd64.tar.gz rails-91183baa6d54428da7ea466f0a854de2e631dd64.tar.bz2 rails-91183baa6d54428da7ea466f0a854de2e631dd64.zip |
Merge pull request #7337 from adzap/string_to_dummy_time
Fix for time type columns with invalid time value
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 9fcee99222..b9d480d9ce 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -970,6 +970,18 @@ class BasicsTest < ActiveRecord::TestCase assert_equal Time.local(2000, 1, 1, 5, 42, 0), topic.bonus_time end + def test_attributes_on_dummy_time_with_invalid_time + # Oracle, and Sybase do not have a TIME datatype. + return true if current_adapter?(:OracleAdapter, :SybaseAdapter) + + attributes = { + "bonus_time" => "not a time" + } + topic = Topic.find(1) + topic.attributes = attributes + assert_nil topic.bonus_time + end + def test_boolean b_nil = Boolean.create({ "value" => nil }) nil_id = b_nil.id |