aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-05 06:26:53 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-05 10:47:52 -0300
commit5054e266ac07da7a2a15173d3d2919948ae1eb6e (patch)
treed08c6bffda7d10b6e7878e84adbb754cce5947a4 /activerecord/test/cases
parent87ac5b42b1ab05f2e72eb4c702742decdceed7c1 (diff)
downloadrails-5054e266ac07da7a2a15173d3d2919948ae1eb6e.tar.gz
rails-5054e266ac07da7a2a15173d3d2919948ae1eb6e.tar.bz2
rails-5054e266ac07da7a2a15173d3d2919948ae1eb6e.zip
Merge pull request #7337 from adzap/string_to_dummy_time
Fix for time type columns with invalid time value Conflicts: activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/base_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index fc33438569..073e856e5e 100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -919,6 +919,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