Skip to content

Commit

Permalink
Fix touching of relations.
Browse files Browse the repository at this point in the history
Due to model saved callback, dirty attributes were reset and touching of relations are not being triggered.
  • Loading branch information
yajra committed Nov 28, 2017
1 parent 8c947f2 commit 7f32c82
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Baum/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -1427,4 +1427,21 @@ protected function determineDepth($node, $nesting = 0)

return [$node, $nesting];
}

/**
* Perform any actions that are necessary after the model is saved.
*
* @param array $options
* @return void
*/
protected function finishSave(array $options)
{
$this->fireModelEvent('saved', false);

if ($options['touch'] ?? true) {
$this->touchOwners();
}

$this->syncOriginal();
}
}

0 comments on commit 7f32c82

Please sign in to comment.