diff options
author | Tobias Lütke <tobias.luetke@gmail.com> | 2005-10-14 12:53:39 +0000 |
---|---|---|
committer | Tobias Lütke <tobias.luetke@gmail.com> | 2005-10-14 12:53:39 +0000 |
commit | 5fa8793f02b58509a90eed69e8dc3d199f89b4ad (patch) | |
tree | b00feb5e67e67c43b20c600ad7bc62dfd98243be /activerecord/test/associations_test.rb | |
parent | 4a1ed01e9d53da87b57802cb99e3ca7956a6eef7 (diff) | |
download | rails-5fa8793f02b58509a90eed69e8dc3d199f89b4ad.tar.gz rails-5fa8793f02b58509a90eed69e8dc3d199f89b4ad.tar.bz2 rails-5fa8793f02b58509a90eed69e8dc3d199f89b4ad.zip |
DRYed up Associations#clear. Closes #1906 [Caleb]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2580 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/associations_test.rb')
-rwxr-xr-x | activerecord/test/associations_test.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index fc8d59e862..5cafa010f9 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -551,13 +551,15 @@ class HasManyAssociationsTest < Test::Unit::TestCase client_id = firm.exclusively_dependent_clients_of_firm.first.id assert_equal 1, firm.exclusively_dependent_clients_of_firm.size + assert_equal [], Client.destroyed_client_ids[firm.id] + # :exclusively_dependent means each client is deleted directly from # the database without looping through them calling destroy. firm.exclusively_dependent_clients_of_firm.clear assert_equal 0, firm.exclusively_dependent_clients_of_firm.size assert_equal 0, firm.exclusively_dependent_clients_of_firm(true).size - assert_equal [], Client.destroyed_client_ids[firm.id] + assert_equal [3], Client.destroyed_client_ids[firm.id] # Should be destroyed since the association is exclusively dependent. assert Client.find_by_id(client_id).nil? |