aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorKuldeep Aggarwal <kd.engineer@yahoo.co.in>2013-12-30 01:53:02 +0530
committerKuldeep Aggarwal <kd.engineer@yahoo.co.in>2013-12-30 01:53:02 +0530
commita2985e206709f7947ef427a527d72ff89824931a (patch)
tree9c42b2f69bb69ed07820f7bb9d9a0eb98acd19c6 /activerecord/test/cases
parent15e2eb42a7b1c251defd088ac65a89f152a307f6 (diff)
downloadrails-a2985e206709f7947ef427a527d72ff89824931a.tar.gz
rails-a2985e206709f7947ef427a527d72ff89824931a.tar.bz2
rails-a2985e206709f7947ef427a527d72ff89824931a.zip
raise `ArgumentError` exception if `Model.where.not` is called with `nil` argument
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/relation/where_chain_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation/where_chain_test.rb b/activerecord/test/cases/relation/where_chain_test.rb
index d44b4dfe3d..fd2420cb88 100644
--- a/activerecord/test/cases/relation/where_chain_test.rb
+++ b/activerecord/test/cases/relation/where_chain_test.rb
@@ -23,6 +23,12 @@ module ActiveRecord
assert_equal([expected], relation.where_values)
end
+ def test_not_with_nil
+ assert_raise ArgumentError do
+ Post.where.not(nil)
+ end
+ end
+
def test_not_in
expected = Arel::Nodes::NotIn.new(Post.arel_table[@name], %w[hello goodbye])
relation = Post.where.not(title: %w[hello goodbye])