Skip to content

Commit

Permalink
Collection::setModel - fixed working with scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed Feb 9, 2016
1 parent ebbdcac commit b75495c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ public function setModel($model)
} else {
$this->model = Yii::createObject($model);
}

$model = $this->model;
$this->updateFormName();

if (empty($this->getScenario()) && $model->scenario !== $model::SCENARIO_DEFAULT) {
if (empty($this->getScenario())) {
$this->setScenario($model->scenario);
}

Expand Down

0 comments on commit b75495c

Please sign in to comment.