Skip to content

Commit

Permalink
Fixed has many cache after dissociation for issue #18.
Browse files Browse the repository at this point in the history
  • Loading branch information
hexus committed Sep 17, 2015
1 parent b114574 commit 1dbf937
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Darya/ORM/Relation/HasMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ public function dissociate($instances = null) {
}
}

$this->reduce($ids);
$relatedIds = array();

foreach ($this->related as $related) {
$relatedIds[] = $related->id();
}

$this->reduce(array_diff($relatedIds, $ids));

return $successful;
}
Expand Down

0 comments on commit 1dbf937

Please sign in to comment.