diff options
author | Murray Steele <muz@h-lame.com> | 2011-03-11 12:02:49 +0000 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-23 14:45:21 -0700 |
commit | 54c963c89b81cfc4fd7dcad6779e41c85d1180ce (patch) | |
tree | bf7697b0b1899a6fd22cf72f762ae7a9724b7209 /actionpack/test/fixtures/filter_test | |
parent | 8ee81d21fb103be31adb8e0dcde8ed8f5e90a798 (diff) | |
download | rails-54c963c89b81cfc4fd7dcad6779e41c85d1180ce.tar.gz rails-54c963c89b81cfc4fd7dcad6779e41c85d1180ce.tar.bz2 rails-54c963c89b81cfc4fd7dcad6779e41c85d1180ce.zip |
Make clearing of HABTM join table contents happen in an after_destory callback.
The old method of redefining destroy meant that clearing the HABTM join table would happen as long as the call to destroy succeeded. Which meant if there was a before_destroy that stopped the instance being destroyed using normal means (returning false, raising ActiveRecord::Rollback) rather than exceptional means the join table would be cleared even though the instance wasn't destroyed. Doing it in an after_destroy hook avoids this and has the advantage of happening inside the DB transaction too.
Diffstat (limited to 'actionpack/test/fixtures/filter_test')
0 files changed, 0 insertions, 0 deletions