set default values only on default scenario

This commit is contained in:
evgen-d 2014-09-12 16:32:03 +04:00
parent 92f2dbb4fe
commit 930d3dcb9f

View File

@ -394,7 +394,9 @@ abstract class ActiveRecord extends BaseActiveRecord
public function init()
{
parent::init();
$this->setAttributes($this->defaultValues(), false);
if ($this->scenario === static::SCENARIO_DEFAULT) {
$this->setAttributes($this->defaultValues(), false);
}
}
public function defaultValues()