X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship.pm;h=e1bed805c0ab775df276facb02dc2589ffbdbec4;hb=90489c23e598723752c9e0d4b4da214ad05e3feb;hp=e3b812b78020f45febdbf80f4e4f2c0d00a81b52;hpb=d4daee7b54e38e4b3d3d0a77759bddc1a4ede6e5;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Relationship.pm b/lib/DBIx/Class/Relationship.pm index e3b812b..e1bed80 100644 --- a/lib/DBIx/Class/Relationship.pm +++ b/lib/DBIx/Class/Relationship.pm @@ -232,13 +232,13 @@ which can be assigned to relationships as well. =back -Creates a one-to-many relationship, where the corresponding elements -of the foreign class store the calling class's primary key in one (or -more) of the foreign class columns. This relationship defaults to using -the end of this classes namespace as the foreign key in C<$related_class> -to resolve the join, unless C<$their_fk_column> specifies the foreign -key column in C<$related_class> or C specifies a reference to a -join condition hash. +Creates a one-to-many relationship where the foreign class refers to +this class's primary key. This relationship refers to zero or more +records in the foreign table (ie, a C). This relationship +defaults to using the end of this classes namespace as the foreign key +in C<$related_class> to resolve the join, unless C<$their_fk_column> +specifies the foreign key column in C<$related_class> or C +specifies a reference to a join condition hash. =over @@ -441,6 +441,17 @@ methods and valid relationship attributes. Also see L for a L which can be assigned to relationships as well. +Note that if you supply a condition on which to join, if the column in the +current table allows nulls (i.e., has the C attribute set to a +true value), than C will warn about this because it's naughty and +you shouldn't do that. + + "might_have/has_one" must not be on columns with is_nullable set to true (MySchema::SomeClass/key) + +If you must be naughty, you can suppress the warning by setting +C environment variable to a true value. Otherwise, +you probably just want to use C. + =head2 has_one =over 4 @@ -528,6 +539,11 @@ methods and valid relationship attributes. Also see L for a L which can be assigned to relationships as well. +Note that if you supply a condition on which to join, if the column in the +current table allows nulls (i.e., has the C attribute set to a +true value), than warnings might apply just as with +L. + =head2 many_to_many =over 4