diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-07 08:53:24 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-07 08:56:49 -0200 |
commit | 89ab303d8b78a73cb7d306a026f185986f44aa2a (patch) | |
tree | c5aa40d2f36e15c775be42a11672f1011302b815 /activerecord/test/cases | |
parent | ee5999d14015782ee06a9d03ff4c2f007a52ac66 (diff) | |
download | rails-89ab303d8b78a73cb7d306a026f185986f44aa2a.tar.gz rails-89ab303d8b78a73cb7d306a026f185986f44aa2a.tar.bz2 rails-89ab303d8b78a73cb7d306a026f185986f44aa2a.zip |
Fix where.not with in clause
Arel::Nodes::In inherits from Arel::Nodes::Equality, so the case
statement was always using the Equality operator for both scenarios,
resulting in a not equal query instead.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/relation/where_chain_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/relation/where_chain_test.rb b/activerecord/test/cases/relation/where_chain_test.rb index 10b19da3fd..8409fc6571 100644 --- a/activerecord/test/cases/relation/where_chain_test.rb +++ b/activerecord/test/cases/relation/where_chain_test.rb @@ -19,7 +19,7 @@ module ActiveRecord end def test_not_in - expected = Arel::Nodes::NotEqual.new(Post.arel_table[:title], %w[hello goodbye]) + expected = Arel::Nodes::NotIn.new(Post.arel_table[:title], %w[hello goodbye]) relation = Post.where.not(title: %w[hello goodbye]) assert_equal([expected], relation.where_values) end |