On 10/20/06, Matt S Trout <[EMAIL PROTECTED]> wrote: > Drew Taylor wrote: > > One thing I discovered after my post which I think is CRITICAL: > > has_one & might_have both use the PK of the local (what's the proper > > terminology?) table as the FK into the foreign table. Perhaps saying > > something like this for the might_have docs: > > > > "Creates an optional one-to-one relationship with a class, where the > > primary key of the foreign class is equal to the primary key of the > > local table. Ie. Foo.id == Bar.id. Unlike belongs_to, might_have ONLY > > suppports using each tables primary key as the key column." > > Erm, except that's not true. > > That's what they use for the *default* when they're guessing the join > condition for you, as documented. If you pass an explicit join condition, they > do whatever you tell them to. > > So clearly an improvement to the docs is "CRITICAL", since even after using it > you still think it does something different to what it actually does :) maybe > you could work on a patch in that direction?
I think Jess' reply is nearly there. The critical piece of information (for me anyway) is the DIRECTION of each relationship. I'll mull it over this weekend and see if I can come up with something both correct and coherent. :-) Drew -- ---------------------------------------------------------------- Drew Taylor * Web development & consulting Email: [EMAIL PROTECTED] * Site implementation & hosting Web : www.drewtaylor.com * perl/mod_perl/DBI/mysql/postgres ---------------------------------------------------------------- _______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
