From 1aa200788cc444c11062ba523d02228eb9291bd0 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 14 May 2014 10:20:23 +1000 Subject: [PATCH] Monkey patching, not required. --- config/application.rb | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/config/application.rb b/config/application.rb index b4f103f8c16..798bec3c520 100644 --- a/config/application.rb +++ b/config/application.rb @@ -11,22 +11,15 @@ if defined?(Bundler) Bundler.require(*Rails.groups(assets: %w(development test profile))) end -# PATCH DB configuration -class Rails::Application::Configuration - - def database_configuration_with_global_config - if Rails.env == "production" - GlobalSetting.database_config - else - database_configuration_without_global_config - end - end - - alias_method_chain :database_configuration, :global_config -end - module Discourse class Application < Rails::Application + def config.database_configuration + if Rails.env == "production" + GlobalSetting.database_config + else + super + end + end # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded.