diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2012-05-10 23:16:40 +0100 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2012-05-10 23:16:40 +0100 |
commit | fa21b73ebb8339ad388f149c817c433b6254d490 (patch) | |
tree | b0bef5fe969dd3ee1e3b8b62738d9c45a626ef5e /activerecord/test | |
parent | 09a48b2324207ccbf6f421e5e7caf7655f1e905a (diff) | |
download | rails-fa21b73ebb8339ad388f149c817c433b6254d490.tar.gz rails-fa21b73ebb8339ad388f149c817c433b6254d490.tar.bz2 rails-fa21b73ebb8339ad388f149c817c433b6254d490.zip |
Return false for exists? with new records - fixes #6199.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/finder_test.rb | 1 | ||||
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index 630acdbc46..c960773284 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -32,6 +32,7 @@ class FinderTest < ActiveRecord::TestCase assert Topic.exists?(:author_name => "Mary", :approved => true) assert Topic.exists?(["parent_id = ?", 1]) assert !Topic.exists?(45) + assert !Topic.exists?(Topic.new) begin assert !Topic.exists?("foo") diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 8cef4423c5..76b868c7b4 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -644,6 +644,7 @@ class RelationTest < ActiveRecord::TestCase assert ! davids.exists?(authors(:mary).id) assert ! davids.exists?("42") assert ! davids.exists?(42) + assert ! davids.exists?(davids.new) fake = Author.where(:name => 'fake author') assert ! fake.exists? |