diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-11-20 11:28:35 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-11-20 11:28:35 +0000 |
commit | ced5d894250b89ecb0ac4f41ccf2f30e6e68042e (patch) | |
tree | 08bdc6fefd519b6222a03da02baede5c89001370 /activerecord | |
parent | 427fb035a3d03b23e903ca499abf3c1bfa53b10a (diff) | |
download | rails-ced5d894250b89ecb0ac4f41ccf2f30e6e68042e.tar.gz rails-ced5d894250b89ecb0ac4f41ccf2f30e6e68042e.tar.bz2 rails-ced5d894250b89ecb0ac4f41ccf2f30e6e68042e.zip |
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
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/test/associations_test.rb | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 759d7b7784..a46d31528e 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -39,7 +39,7 @@ * Deprecation: object transactions warning. [Jeremy Kemper] -* has_one :dependent => :nullify ignores nil associates. #6528 [janovetz, Jeremy Kemper] +* has_one :dependent => :nullify ignores nil associates. #4828, #6528 [bellis@deepthought.org, janovetz, Jeremy Kemper] * Oracle: resolve test failures, use prefetched primary key for inserts, check for null defaults, fix limited id selection for eager loading. Factor out some common methods from all adapters. #6515 [Michael Schoen] 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) |