From ecba98031dd2bb5b9fbeec5c576ba40dc738e86f Mon Sep 17 00:00:00 2001 From: Nils Mueller Date: Thu, 8 Nov 2018 19:52:13 +0100 Subject: [PATCH] Explicitly require ApplicationController Without the explicit require statement it is possible that the controller will inherit from the wrong ApplicationController. This can happen in development when a different ApplicationController has already been loaded and Rails then doesn't run into const_missing anymore when trying to load ApplicationController. --- app/controllers/pg_bouncer_hero/database_controller.rb | 2 ++ app/controllers/pg_bouncer_hero/home_controller.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/controllers/pg_bouncer_hero/database_controller.rb b/app/controllers/pg_bouncer_hero/database_controller.rb index 0f26816..0c39aa6 100644 --- a/app/controllers/pg_bouncer_hero/database_controller.rb +++ b/app/controllers/pg_bouncer_hero/database_controller.rb @@ -1,3 +1,5 @@ +require_dependency 'pg_bouncer_hero/application_controller' + module PgBouncerHero class DatabaseController < ApplicationController def summary diff --git a/app/controllers/pg_bouncer_hero/home_controller.rb b/app/controllers/pg_bouncer_hero/home_controller.rb index 492e3e1..b3ae357 100644 --- a/app/controllers/pg_bouncer_hero/home_controller.rb +++ b/app/controllers/pg_bouncer_hero/home_controller.rb @@ -1,3 +1,5 @@ +require_dependency 'pg_bouncer_hero/application_controller' + module PgBouncerHero class HomeController < ApplicationController def index