diff options
author | Yaroslav Markin <yaroslav@markin.net> | 2008-12-27 16:26:13 +0300 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-12-27 14:36:11 +0100 |
commit | 6e98adfc8e19a39fa45d4acd94145d318d151964 (patch) | |
tree | 014c82461f81ee3bdf42e1a5574cef92e96051a2 /activerecord/test/cases | |
parent | 4f043a48381c142e308824e3b7e15435a61bbb53 (diff) | |
download | rails-6e98adfc8e19a39fa45d4acd94145d318d151964.tar.gz rails-6e98adfc8e19a39fa45d4acd94145d318d151964.tar.bz2 rails-6e98adfc8e19a39fa45d4acd94145d318d151964.zip |
ActiveRecord::Base#new_record? now returns false for existing records (was nil) [#1219 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
Diffstat (limited to 'activerecord/test/cases')
-rwxr-xr-x | activerecord/test/cases/base_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index ce77ba4dbf..0f03dae829 100755 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1198,6 +1198,11 @@ class BasicsTest < ActiveRecord::TestCase assert b_true.value? end + def test_new_record_returns_boolean + assert_equal Topic.new.new_record?, true + assert_equal Topic.find(1).new_record?, false + end + def test_clone topic = Topic.find(1) cloned_topic = nil |