[Dbix-class] $foreign_key_column in DBIx::Class::Relationship
belongs_to
Adrian Corston
adrian at youramigo.com
Tue Feb 20 03:02:21 GMT 2007
Hello all,
In the DBIx::Class::Relationship pod (0.07999_02 from CPAN) it says that =
the third argument to belongs_to() (and indeed all the other =
relationships) can be a "$foreign_key_column" which "...specifies the =
foreign key column in $related_class..." however the code on line 31 of =
DBIx/Class/Relationship/BelongsTo.pm checks that value against $class =
and not $f_class, and line 39 of the same file adds a relationship =
against the $class (ie. "self.${fk}") so there is a significant =
discrepency between the documentation and the actual functionality. =
Which is right?
Obviously, to specify a foreign key column other than the primary key =
I'm instead using the hashref form of the third argument.
Cheers,
A.
-- =
Adrian Corston
Support Engineer
YourAmigo
IMPORTANT - This email message is for the sole use of the intended recipien=
t(s) and may contain confidential and privileged information in which case =
neither is intended to be waived. YourAmigo retains ownership of all copyri=
ght, trade secrets and other intellectual property rights in the email and =
attachments. Any unauthorized review, use, disclosure or distribution is pr=
ohibited. If you are not the intended recipient, please notify us and remov=
e it from your system. It is your responsibility to check any attachments f=
or viruses and defects before opening or sending them on. YourAmigo collect=
s personal information to provide and market our services. For more informa=
tion about use, disclosure and access, see our privacy policy at http://www=
.youramigo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070220/07c=
8f5e2/attachment.htm
More information about the Dbix-class
mailing list