Skip to content

Commit 1dbf937

Browse files
committed
Fixed has many cache after dissociation for issue #18.
1 parent b114574 commit 1dbf937

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Darya/ORM/Relation/HasMany.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ public function dissociate($instances = null) {
109109
}
110110
}
111111

112-
$this->reduce($ids);
112+
$relatedIds = array();
113+
114+
foreach ($this->related as $related) {
115+
$relatedIds[] = $related->id();
116+
}
117+
118+
$this->reduce(array_diff($relatedIds, $ids));
113119

114120
return $successful;
115121
}

0 commit comments

Comments
 (0)