kwakwaversal / mojolicious-plugin-restify

Route shortcuts & helpers for REST collections - https://metacpan.org/pod/Mojolicious::Plugin::Restify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug when adding nested route doesn't honour the initial 'controller' namespace

kwakwaversal opened this issue · comments

  # Attach nested routes to an existing route
  my $attach = $r->any('/attach')->under->to('attach#authenticate');
  $self->restify->routes(
    $attach,
    {'global-users' => {'roles' => undef}},
    {controller     => 'attach'}
  );

In the example above, the attach controller is not used as the initial controller namespace. So Mojo was trying to access MyApp::GlobalUsers::Roles instead of MyApp::Attach::GlobalUsers::Roles.