mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add a test case of nested empty array values in conditions
Post.where(id: [[]]).to_a Used to fail with a SQL syntax error (until 4.1): SELECT ... WHERE id in (); It now properly generate: SELECT ... WHERE 1=0;
This commit is contained in:
parent
d20270612c
commit
6fdf5167b7
1 changed files with 4 additions and 0 deletions
|
@ -180,6 +180,10 @@ module ActiveRecord
|
|||
assert_equal 0, Post.where(:id => []).count
|
||||
end
|
||||
|
||||
def test_where_with_table_name_and_nested_empty_array
|
||||
assert_equal [], Post.where(:id => [[]]).to_a
|
||||
end
|
||||
|
||||
def test_where_with_empty_hash_and_no_foreign_key
|
||||
assert_equal 0, Edge.where(:sink => {}).count
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue