Skip to content

Commit

Permalink
This check is redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Feb 10, 2025
1 parent 8d4d37a commit a6835da
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/Database/Traits/NestedTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,13 @@ public function initializeNestedTree()
$this->deleteDescendants();
});

if (
static::hasGlobalScope(\October\Rain\Database\Scopes\SoftDeleteScope::class) ||
static::hasGlobalScope(\Illuminate\Database\Eloquent\SoftDeletingScope::class)
) {
$this->bindEvent('model.beforeRestore', function () {
$this->shiftSiblingsForRestore();
});
$this->bindEvent('model.beforeRestore', function () {
$this->shiftSiblingsForRestore();
});

$this->bindEvent('model.afterRestore', function () {
$this->restoreDescendants();
});
}
$this->bindEvent('model.afterRestore', function () {
$this->restoreDescendants();
});
}

/**
Expand Down

0 comments on commit a6835da

Please sign in to comment.