Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix segfault on infinite recursion into circular model relations
In cases where related models were set before save on *both* sides of a hasMany/belongsTo relationship, `Model::save()` would go into an infinite loop as its pre and post-save checks for relations to save never checked if the related model had already been saved: Save A \_ A hasMany B \_ Save B \_ B belongsTo A \_ Save A \_ ... For me this was causing a segfault, though with xdebug installed it would error before crashing at the max_nesting_level.
- Loading branch information