mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Monkey patching, not required.
This commit is contained in:
parent
42c67f719b
commit
1aa200788c
1 changed files with 7 additions and 14 deletions
|
@ -11,22 +11,15 @@ if defined?(Bundler)
|
||||||
Bundler.require(*Rails.groups(assets: %w(development test profile)))
|
Bundler.require(*Rails.groups(assets: %w(development test profile)))
|
||||||
end
|
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
|
module Discourse
|
||||||
class Application < Rails::Application
|
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.
|
# Settings in config/environments/* take precedence over those specified here.
|
||||||
# Application configuration should go into files in config/initializers
|
# Application configuration should go into files in config/initializers
|
||||||
# -- all .rb files in that directory are automatically loaded.
|
# -- all .rb files in that directory are automatically loaded.
|
||||||
|
|
Loading…
Reference in a new issue