Skip to content

Commit

Permalink
Fixed bug when trying to save junction table rows for related models …
Browse files Browse the repository at this point in the history
…that were not saved before.
  • Loading branch information
sspat committed Jun 7, 2017
1 parent e2043b5 commit 92cdda5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SaveRelationsBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ public function afterSave()
if ($relation->via !== null) {
$relationModel->save(false);
}
$model->link($relationName, $relationModel);
$junctionTableColumns = $this->_getJunctionTableColumns($relationName, $relationModel);
$model->link($relationName, $relationModel, $junctionTableColumns);
} else {
$existingRecords[] = $relationModel;
}
Expand Down

0 comments on commit 92cdda5

Please sign in to comment.