[Catalyst] Can't get my db classes to have relations

Dennis Daupert ddaupert at sbcglobal.net
Sun Jul 9 05:16:27 CEST 2006


>> Line 23 of CatapultDB::UserRoles is: 
>>  
>> __PACKAGE__->belongs_to(user => 'CatapultDB::Users', 'user_id'); 
 
>And the class is called Catapult::Schema::CatapultDB::Users. 
 
>Try passing it the class name that actually exists :)

Ah, ok, I was thinking about the way schema objects are accessed in the controller:

$c->model('CatapultDB::Someclass')

instead of the "path/to" version

$c->model('Path:to::CatapultDB::Someclass')

I expected a similar pattern here, and that tripped me up. Your hint pointed me in the right direction; the code works much better now!

/dennis


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060708/8adb4cdc/attachment.htm 


More information about the Catalyst mailing list