Change order in generate_rs so that stash->{class} always overrides ->class Add tests
[catagits/Catalyst-Controller-DBIC-API.git] / lib / Catalyst / Controller / DBIC / API.pm
index b595fb4..d3c2d0a 100644 (file)
@@ -202,7 +202,7 @@ sub generate_rs
 {
     my ($self, $c) = @_;
 
-    return $c->model($self->class || $c->stash->{class});
+    return $c->model($c->stash->{class} || $self->class);
 }
 
 =method_protected inflate_request