uninitialized constant RailsPgExtras::Web::QueriesController::ACTIONS
peaonunes opened this issue · 2 comments
Hey everyone, I was using the gem and decided to mount the Web routes to use the dashboard. However, I got an uninitialized constant RailsPgExtras::Web::QueriesController::ACTIONS
error when accessing the route.
I believe that is happening because my application also has a definition of ApplicationController
and thus the QueriesController
might be inheriting from that instead of the one in rails_pg_extras/web. Mostly because inheritance does not have the module scope in it;
https://github.com/pawurb/rails-pg-extras/blob/master/app/controllers/rails_pg_extras/web/queries_controller.rb#L2-L4
I got the route to work after a monkey-patch where I changed the inheritance to inherit explicitly from the web module.
class QueriesController < RailsPgExtras::Web::ApplicationController
I'm wondering now what's the most appropriate way to fix it. If there would be something to do on the application side. Or if we should change the gem's code somehow given ApplicationController
is a pretty common name. Happy to hear anyone else thoughts on this too.
@peaonunes thanks for reporting! I've added namespacing in 4.0.1. Please confirm it works now.
@peaonunes thanks for reporting! I've added namespacing in 4.0.1. Please confirm it works now.
Hey, no worries! It worked out well, thanks for the fast reply!