set default values only on default scenario
This commit is contained in:
parent
92f2dbb4fe
commit
930d3dcb9f
|
@ -394,7 +394,9 @@ abstract class ActiveRecord extends BaseActiveRecord
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
parent::init();
|
parent::init();
|
||||||
$this->setAttributes($this->defaultValues(), false);
|
if ($this->scenario === static::SCENARIO_DEFAULT) {
|
||||||
|
$this->setAttributes($this->defaultValues(), false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function defaultValues()
|
public function defaultValues()
|
||||||
|
|
Loading…
Reference in New Issue