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