Skip to content
This repository has been archived by the owner on May 14, 2019. It is now read-only.

Commit

Permalink
Fixing issue 3. Dependent on hasOne failed if one relation is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
bermi committed Jun 19, 2011
1 parent 34b93ad commit a66bf47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion active_record/associations/has_one.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public function afterDestroy(&$object) {
if ($object->$associated_id->getType() == 'hasOne'){
$object->$associated_id->load();
}
if(empty($object->$associated_id->id) || $object->$associated_id->getType() == 'hasOne' || $object->$associated_id->isNewRecord()) return true;
if(empty($object->$associated_id->id) || $object->$associated_id->getType() == 'hasOne' || $object->$associated_id->isNewRecord()) continue;
switch ($dependency) {

case 'delete':
Expand Down

0 comments on commit a66bf47

Please sign in to comment.