On 6 Mar 2008, at 11:12, 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.
You are passing the wrong thing to $c->model and its falling back to
the (hateful) regexp search.
Assuming your DBIC::Schema model is MyApp::Model::DBModel you want $c-
>model('DBModel::Role').
-ash
_______________________________________________
List: Catalyst@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/