diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-04 11:31:58 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-04 11:58:44 -0300 |
commit | a502703c3d2151d4d3b421b29fefdac5ad05df61 (patch) | |
tree | 26d2062847b25b296ca753f71fef38e217e0de26 /activerecord/test | |
parent | 07d3d402341e81ada0214f2cb2be1da69eadfe72 (diff) | |
download | rails-a502703c3d2151d4d3b421b29fefdac5ad05df61.tar.gz rails-a502703c3d2151d4d3b421b29fefdac5ad05df61.tar.bz2 rails-a502703c3d2151d4d3b421b29fefdac5ad05df61.zip |
Change the behavior of boolean columns to be closer to Ruby's semantics.
Before this change we had a small set of "truthy", and all others
are "falsy".
Now, we have a small set of "falsy" values and all others are
"truthy" matching Ruby's semantics.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/types_test.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/activerecord/test/cases/types_test.rb b/activerecord/test/cases/types_test.rb index b0979cbe1f..73e92addfe 100644 --- a/activerecord/test/cases/types_test.rb +++ b/activerecord/test/cases/types_test.rb @@ -17,6 +17,10 @@ module ActiveRecord assert type.type_cast_from_user('TRUE') assert type.type_cast_from_user('on') assert type.type_cast_from_user('ON') + assert type.type_cast_from_user(' ') + assert type.type_cast_from_user("\u3000\r\n") + assert type.type_cast_from_user("\u0000") + assert type.type_cast_from_user('SOMETHING RANDOM') # explicitly check for false vs nil assert_equal false, type.type_cast_from_user(false) @@ -28,12 +32,6 @@ module ActiveRecord assert_equal false, type.type_cast_from_user('FALSE') assert_equal false, type.type_cast_from_user('off') assert_equal false, type.type_cast_from_user('OFF') - assert_deprecated do - assert_equal false, type.type_cast_from_user(' ') - assert_equal false, type.type_cast_from_user("\u3000\r\n") - assert_equal false, type.type_cast_from_user("\u0000") - assert_equal false, type.type_cast_from_user('SOMETHING RANDOM') - end end def test_type_cast_float |