diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-21 18:58:44 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-21 18:58:44 +0900 |
commit | f8a798c8e60a9b288496b99b5e38e4f10d2f7c0e (patch) | |
tree | a805ca26f8b3e72681fda6918583825305c2e915 /activerecord/test | |
parent | b57ca840a6fe64b7a76bc6585dff26e5c08879fb (diff) | |
parent | 357cd23d3aedabb99fd70b812ffcea2d1cc9893d (diff) | |
download | rails-f8a798c8e60a9b288496b99b5e38e4f10d2f7c0e.tar.gz rails-f8a798c8e60a9b288496b99b5e38e4f10d2f7c0e.tar.bz2 rails-f8a798c8e60a9b288496b99b5e38e4f10d2f7c0e.zip |
Merge pull request #35336 from kamipo/dont_allow_non_numeric_string_matches_to_zero
Don't allow `where` with non numeric string matches to 0 values
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relation/where_test.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/cases/relation/where_test.rb b/activerecord/test/cases/relation/where_test.rb index bec204643b..5c729e68cd 100644 --- a/activerecord/test/cases/relation/where_test.rb +++ b/activerecord/test/cases/relation/where_test.rb @@ -51,8 +51,9 @@ module ActiveRecord end def test_where_with_invalid_value - topics(:first).update!(written_on: nil, bonus_time: nil, last_read: nil) + topics(:first).update!(parent_id: 0, written_on: nil, bonus_time: nil, last_read: nil) assert_empty Topic.where(parent_id: Object.new) + assert_empty Topic.where(parent_id: "not-a-number") assert_empty Topic.where(written_on: "") assert_empty Topic.where(bonus_time: "") assert_empty Topic.where(last_read: "") |