Fixing issues where ModelBehavior::detach() would not detach behaviors when a plugin.name was provided. This change makes detach() work like attach(). Tests added. Fixes #711

This commit is contained in:
Mark Story 2010-05-11 23:08:14 -04:00
parent 0648c6604b
commit 79839c07d2
2 changed files with 23 additions and 0 deletions

View file

@ -372,6 +372,7 @@ class BehaviorCollection extends Object {
* @access public
*/
function detach($name) {
list($plugin, $name) = pluginSplit($name);
if (isset($this->{$name})) {
$this->{$name}->cleanup(ClassRegistry::getObject($this->modelName));
unset($this->{$name});