[Catalyst] How can it be - wrong model returned?

Andreas Marienborg omega at palle.net
Thu Mar 6 11:21:01 GMT 2008


Include the model-name, not only the table

$c->model('DBIC::Pwuser') for instance

- andreas

On Mar 6, 2008, at 12:12 PM, Alex Povolotsky wrote:

> Hello!
>
> I've made a simple many-to-many relationship for user/roles  
> authentication, and suddenly found that
>
>   my $model = $c->model('Pwuser')->search()->all();
>   my $roles = $c->model('Role')->search()->all();
>   my $ur = $c->model('UserRole')->search()->all();
>
> results in
>
> SELECT me.uid, me.login, me.password FROM pwuser me:
> SELECT me.uid, me.rid FROM user_role me:
> SELECT me.uid, me.rid FROM user_role me:
>
> nothing get selected from role table, and $c->model('Role')->search- 
> >all selects from wrong table.
>
> How can it be and what can I do?...
>
> Alex.
>
>
> _______________________________________________
> 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