and multiple codepaths expect _resolve_condition to always return something
akin to $vals_from_related above. A grep for _resolve_condition will
highlight the problematic use-cases
+
+Additional Note:
+
+When using extended_rels all cascade options default to 0.
$cond = { "foreign.${f_key}" => "self.${pri}" };
}
+ my $default_cascade = ref $cond eq 'CODE' ? 0 : 1;
+
$class->add_relationship($rel, $f_class, $cond, {
accessor => 'multi',
join_type => 'LEFT',
- cascade_delete => 1,
- cascade_copy => 1,
+ cascade_delete => $default_cascade,
+ cascade_copy => $default_cascade,
%{$attrs||{}}
});
}
$cond = { "foreign.${f_key}" => "self.${pri}" };
}
$class->_validate_has_one_condition($cond);
+
+ my $default_cascade = ref $cond eq 'CODE' ? 0 : 1;
+
$class->add_relationship($rel, $f_class,
$cond,
{ accessor => 'single',
- cascade_update => 1, cascade_delete => 1,
+ cascade_update => $default_cascade,
+ cascade_delete => $default_cascade,
($join_type ? ('join_type' => $join_type) : ()),
%{$attrs || {}} });
1;