Steffen Kremsler wrote:
> Well I just overlooked that the tutorial DBIx schema classes
> User.pm and Role.pm didn't have many-to-many relationships
> defined. Whereas they were defined in Book.pm and Author.pm.
> So i added the following lines
> 
> to User.pm:
> __PACKAGE__->many_to_many(roles => 'map_user_role', 'role');
> 
> to Role.pm:
> __PACKAGE__->many_to_many(users => 'map_user_role', 'user');
> 
> and it works now.
> 
> Sometimes it helps getting a break and some distance. :)
> But i'm still wondering why
>      [% FOR role = Catalyst.user.roles %][% role %] [% END %]
> did work before then.

That uses the roles method on the 
Catalyst::Plugin::Authentication::Store::DBIC::User object rather than the 
underlying DBIC object (which would be Catalyst.user.obj)

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to