Skip to content

Commit

Permalink
Pass options into cascaded deletes.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 3, 2013
1 parent 1c38fc7 commit 701822c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cake/ORM/Association/DependentDeleteTrait.php
Expand Up @@ -50,7 +50,7 @@ public function cascadeDelete(Entity $entity, $options = []) {

$query = $table->find('all')->where($conditions);
foreach ($query as $related) {
$table->delete($related, ['atomic' => false]);
$table->delete($related, $options);
}
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions Cake/Test/TestCase/ORM/Association/HasManyTest.php
Expand Up @@ -469,10 +469,10 @@ public function testCascadeDelete() {

$this->article->expects($this->at(1))
->method('delete')
->with($articleOne, ['atomic' => false]);
->with($articleOne, []);
$this->article->expects($this->at(2))
->method('delete')
->with($articleTwo, ['atomic' => false]);
->with($articleTwo, []);

$entity = new Entity(['id' => 1, 'name' => 'mark']);
$this->assertTrue($association->cascadeDelete($entity));
Expand Down

0 comments on commit 701822c

Please sign in to comment.