diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-04-20 18:12:40 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-04-20 18:12:40 +0100 |
commit | de0ea3866370ec61581f910cf393a3cc97eba32f (patch) | |
tree | b32efb2bea337b96c875ac5e78c39760c5e663bf /activerecord/test/cases | |
parent | 489abfd3b23f3c4b3de86aeb3bde3970771c001b (diff) | |
download | rails-de0ea3866370ec61581f910cf393a3cc97eba32f.tar.gz rails-de0ea3866370ec61581f910cf393a3cc97eba32f.tar.bz2 rails-de0ea3866370ec61581f910cf393a3cc97eba32f.zip |
Ensure :dependent => :delete_all works for association with hash conditions
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 30edf79a26..5df74fcdcd 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -719,6 +719,12 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert Client.find(:all, :conditions => "firm_id=#{firm.id}").empty? end + def test_dependence_for_associations_with_hash_condition + david = authors(:david) + post = posts(:thinking).id + assert_difference('Post.count', -1) { assert david.destroy } + end + def test_destroy_dependent_when_deleted_from_association firm = Firm.find(:first) assert_equal 2, firm.clients.size |