-
-
Notifications
You must be signed in to change notification settings - Fork 34
Improve automatic detaching / deletion of relations #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
b4b78cc
initial commit to handle special softDelete case for relations with p…
mjauvin b8d03da
first draft at solving the issue
mjauvin 3ac6908
code improvements
mjauvin 22dad8f
fix the Database Model instead of patching the Auth/User model
mjauvin 9fac408
the delete relation option should not apply to pivot table records
mjauvin 3a1464b
Update src/Database/Model.php
bennothommo 01df0d9
Apply suggestions from code review
bennothommo 8b9d6fe
make sure not to leave orphans
mjauvin 1c1114b
no need for delete option, the relation pivot records are detached al…
mjauvin 6672a0b
small tweak
mjauvin 97ff392
initial sofdelete trait tests
mjauvin 3770e94
verify the relation "detach" option
mjauvin b82e651
add unit test for soft delete/restore
mjauvin e51407c
remove empty line
mjauvin e35a61a
remove namespace
mjauvin 4c9c84d
relation var only needed in else block
mjauvin f8face7
namespace IS required
mjauvin 00ae0dd
skip early if null
mjauvin e9595b2
cleanup
mjauvin 4ae7171
Merge branch 'develop' into wip/softdelete-pivot
mjauvin 302ce88
do not remove has{One,Many}Through related records
mjauvin 913af0c
belongsTo and morphTo relation should not be deleted
mjauvin 821b8ee
Update src/Database/Model.php
LukeTowers 85dcfc2
only handle known relation types
mjauvin f1355b6
apply same logic to softDeleted relations
mjauvin 75e1865
add model delete tests for all relation types
mjauvin d0ef473
remove empty line
mjauvin e827d0a
set namespace
mjauvin 4e625a3
add missing test for morphedByMany
mjauvin fa4a2dc
make tests more resilients without hardcoded counts
mjauvin bed6650
add more comments and cleanup
mjauvin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.