[Catalyst] (Beginner) Problem listing users in DB -- solved

Steffen Kremsler mls at truthdoesntexist.org
Sun Oct 22 21:24:03 CEST 2006


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.

Cheers,
Steffen K.



More information about the Catalyst mailing list