On Sun, Apr 22, 2007 at 10:15:07PM -0700, Bill Moseley wrote:
> If the foreign key is not specified DBIx::Class::Relationship::HasMany
> makes this as a guess:
>
> $class =~ /([^\:]+)$/;
> $f_key = lc $1; # go ahead and guess; best we can do
> $guess = "using our class name '$class' as foreign key";
> }
>
> Would a better guess be to look at the foreign table and see in any
> columns are pointing to the table making the has_many relationship?
> That is, look for a belongs_to relationship on the class.
Patches+tests to support this welcome.
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director Want a managed development or deployment platform?
Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
http://www.shadowcatsystems.co.uk/
_______________________________________________
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]/