From de75af7acc5c05c708443de40e78965925165217 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Mon, 5 Nov 2012 13:56:30 +0900 Subject: Relation.where with no args can be chained with not, like, and not_like examples: Model.where.not field: nil #=> "SELECT * FROM models WHERE field IS NOT NULL Model.where.like name: 'Jeremy%' #=> "SELECT * FROM models WHERE name LIKE 'Jeremy%' this feature was originally suggested by Jeremy Kemper https://github.com/rails/rails/pull/5950#issuecomment-5591330 Closes #5950 --- activerecord/test/cases/associations/has_many_associations_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb') diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index e5022d49f1..664f636176 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -271,7 +271,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase end def test_find_with_blank_conditions - [[], {}, nil, ""].each do |blank| + [[], {}, ""].each do |blank| assert_equal 2, Firm.all.merge!(:order => "id").first.clients.where(blank).to_a.size end end -- cgit v1.2.3