From: David Schmidt Date: Mon, 30 Dec 2013 08:52:48 +0000 (+0100) Subject: better explanation for optional fk values in rels (3rd try) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=26e03138c214ca4a7bfe3bec76b6e33197c89419;p=dbsrgits%2FDBIx-Class-Historic.git better explanation for optional fk values in rels (3rd try) --- diff --git a/lib/DBIx/Class/Relationship.pm b/lib/DBIx/Class/Relationship.pm index 979630f..634b966 100644 --- a/lib/DBIx/Class/Relationship.pm +++ b/lib/DBIx/Class/Relationship.pm @@ -191,11 +191,8 @@ more info see L. # To retrieve the plain id if you used the ugly version: $book->get_column('author_id'); -If the column containing the foreign key of a relationship -is nullable, the belongs_to relationship still does the -right thing. (i.e. C<< $obj->author >> would return C). -However you probably want to set the -L attribute so that +If the foreign key column is nullable you probably want to set +the L attribute so that a C is done. This ensures that relationship traversal works consistently in all situations. (i.e. resultsets involving C or C operations). The modified declaration is shown below: