C<Item::Links> is a many-to-many linking table, linking items back to
themselves in a peer fashion (without a "parent-child" designation)
+=head4 Custom join conditions
+
To specify joins which describe more than a simple equality of column
values, the custom join condition coderef syntax can be used. For
example:
'4', '1990', '1979'
Note that in order to be able to use
-L<< $row->create_related|DBIx::Class::Relationship::Base/create_related >>,
+L<< $result->create_related|DBIx::Class::Relationship::Base/create_related >>,
the coderef must not only return as its second such a "simple" condition
hashref which does not depend on joins being available, but the hashref must
contain only plain values/deflatable objects, such that the result can be
=back
# These pairs do the same thing
- $row = $cd->related_resultset('artist')->single; # has_one relationship
- $row = $cd->artist;
+ $result = $cd->related_resultset('artist')->single; # has_one relationship
+ $result = $cd->artist;
$rs = $cd->related_resultset('tracks'); # has_many relationship
$rs = $cd->tracks;
my $rel = shift;
- return $self->{related_resultsets}{$rel} ||= do {
+ return $self->{related_resultsets}{$rel}
+ if defined $self->{related_resultsets}{$rel};
+
+ return $self->{related_resultsets}{$rel} = do {
my $rel_info = $self->relationship_info($rel)
or $self->throw_exception( "No such relationship '$rel'" );