Skip to content

Conversation

@jcwatson11
Copy link

During the "saved" event, the reload() method is called, which, in turn calls getFreshInstance() and wipes out all relations that were on the model before save.

This breaks laravel's $model->push() method because it removes any relations that could be recursively saved.

Our use case involves a Hierarchical reference list that also carries translations as a relation. When we call push() all translations are wiped out because Baum loaded a fresh instance and tried to replace its relations with the empty set from the new model instance.

This pull request fixes that issue.

@jcwatson11
Copy link
Author

It appears that unit tests are failing in the master branch. As far as I can tell, the tests that are failing have nothing to do with this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant