Ovid wrote: > > > Also, you stated that "might_have is the LEFT JOIN version of has_many." The > docs say "one-to-one". Which is correct?
Rob is wrong - might_have and has_many produce identical SQL. The difference is how the result is interpreted. has_many is a multi-type accessor, so when you call ->doodads you get a resultset object from which 0 or more objects can be retrieved. If instead you use might_have, calling the accessor (which you'll probably call->doodad, instead of doodads) will either return a *row* object, or undef. If the sql contains more than 1 result, the first one is turned into an object, and the rest of the results is discarded with a loud warning. _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[email protected]
