From ced5d894250b89ecb0ac4f41ccf2f30e6e68042e Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 20 Nov 2006 11:28:35 +0000 Subject: Test has_one :dependent => :nullify with missing association. Closes #4828. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5594 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/associations_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index f962537966..5b5066290f 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -345,6 +345,13 @@ class HasOneAssociationsTest < Test::Unit::TestCase firm.destroy end + def test_dependence_with_missing_association_and_nullify + Account.destroy_all + firm = DependentFirm.find(:first) + assert firm.account.nil? + firm.destroy + end + def test_assignment_before_parent_saved firm = Firm.new("name" => "GlobalMegaCorp") firm.account = a = Account.find(1) -- cgit v1.2.3