Skip to content

Commit

Permalink
Many relations will never resolve to null
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Apr 19, 2024
1 parent 60f7f95 commit 1e5308b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Database/Relations/AttachMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function setSimpleValue($value)
{
// Nulling the relationship
if (!$value) {
$this->parent->setRelation($this->relationName, null);
$this->parent->unsetRelation($this->relationName);

if ($this->parent->exists) {
$this->parent->bindEventOnce('model.afterSave', function() {
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Relations/HasMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function setSimpleValue($value)
{
// Nulling the relationship
if (!$value) {
$this->parent->setRelation($this->relationName, null);
$this->parent->unsetRelation($this->relationName);

if ($this->parent->exists) {
$this->parent->bindEventOnce('model.afterSave', function() {
Expand Down

0 comments on commit 1e5308b

Please sign in to comment.