Browse files

Fixing issue 3. Dependent on hasOne failed if one relation is empty.

  • Loading branch information...
1 parent 34b93ad commit a66bf476bf321cd5abe6722332b4288833e38692 @bermi bermi committed Jun 19, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 active_record/associations/has_one.php
View
2 active_record/associations/has_one.php
@@ -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':

0 comments on commit a66bf47

Please sign in to comment.