don’t know if it would be the same problem, but yesterday i was facing a “insert the record twice” problem like this and it was just that i removed the ajaxValidation from create action and let the enableAjaxValidation = true in the form…
You can overwrite CActiveRecord::save() method itself in the model, if your business logic really needs it.
class User extends CActiveRecord
{
public function save($runValidation = true, $attributes = null)
{
$this->setIsNewRecord(true);
return parent::save($runValidation, $attributes);
}
}
EDIT: As topic title says you want to do it in a behavior, so the above is not a solution.