[Catalyst] Tutorial woes.

Roderick A. Anderson raanders at cyber-office.net
Thu Aug 11 18:10:00 GMT 2011


Darius Jokilehto wrote:
> On 11/08/11 00:06, Roderick A. Anderson wrote:
>> I can't find where my error is while doing the tutorial.
>>
> [snip]
>>
>> Here are the results of a recursive grep starting at MyApp looking for 
>> role_id.
>>
>> lib/MyApp/Schema/Result/User.pm:110:__PACKAGE__->many_to_many(roles => 
>> 'user_roles', 'role_id');
>>
> [snip]
> You probably want:
> 
> __PACKAGE__->many_to_many(roles => 'user_roles', 'role');

Bingo!  That was it.  Looked to make sure I hadn't typed it in wrong and 
didn't.  The Tutorial has role_id instead of role.

There was another message (last year) that mentioned something similar 
but my Catalyst foo is very low so I didn't know how to apply it to my 
situation.


Thanks,
Rod
-- 
> Assuming your belongs_to in Result::User is called 'role', you have to 
> use that as your final argument - many-to-many requires its final 
> argument to be a relationship, not a column name.
> 
> Darius
> 
> NET-A-PORTER.COM Irresistible fashion at your fingertips
> 
> ______________________________________________________________________
> 
> CONFIDENTIALITY NOTICE
> The information in this email is confidential and is intended solely for 
> the addressee. Access to this email by anyone else is unauthorised. If 
> you are not the intended recipient, you must not read, use or 
> disseminate the information. Any views expressed in this message are 
> those of the individual sender, except where the sender specifically 
> states them to be the views of Net a Porter Ltd.
> Net A Porter Ltd is a company registered in England & Wales Number: 
> 3820604 Registered Office: 1 The Village Offices, Westfield, Ariel Way, 
> London, W12 7GF
> _____________________________________________________________________
> 
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/




More information about the Catalyst mailing list