- Classes submitted as result_class for a resultsource are now
automatically loaded via ensure_loaded()
- 'result_class' resultset attribute, identical to result_class()
- - add 'null_on_fk' option for relationship accessors of type 'single'.
+ - add 'undef_on_null_fk' option for relationship accessors of type 'single'.
This will prevent DBIC from querying the database if one or more of
the key columns IS NULL. Tests + docs (groditi)
- for 'belongs_to' rels, 'null_on_fk' defaults to true.
my $cond = $self->result_source->resolve_condition(
$rel_info->{cond}, $rel, $self
);
- if( exists $rel_info->{attrs}->{undef_on_null_fk}
- && $rel_info->{attrs}->{undef_on_null_fk} ){
+ if ($rel_info->{attrs}->{undef_on_null_fk}){
return if grep { not defined } values %$cond;
}
my $val = $self->find_related($rel, {}, {});