From 45d1f123d7ce14c791659194817b2cf97a326207 Mon Sep 17 00:00:00 2001 From: Kevin Dew Date: Thu, 3 Oct 2019 17:18:58 +0100 Subject: [PATCH] GovukLogging is required before Railtie This ordering was causing a problem for govuk_publishing_components which prevented assets to be pre-compiled: ``` govuk_publishing_components git:(master) RAILS_ENV=production GOVUK_APP_DOMAIN=www.gov.uk GOVUK_WEBSITE_ROOT=https://www.gov.uk rake assets:precompile rake aborted! NameError: uninitialized constant GovukAppConfig::Railtie::GovukLogging /Users/kevindew/govuk/govuk_publishing_components/spec/dummy/config/initializers/content_security_policy.rb:1:in `' /Users/kevindew/govuk/govuk_publishing_components/spec/dummy/config/environment.rb:5:in `' /Users/kevindew/govuk/govuk_publishing_components/Rakefile:18:in `block (2 levels) in ' ``` This was due to the Railtie file executing it's initializer before the remaining files had been required. This can be resolved with the Railtie being required last. --- lib/govuk_app_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/govuk_app_config.rb b/lib/govuk_app_config.rb index 7028c5dd..c9469adf 100644 --- a/lib/govuk_app_config.rb +++ b/lib/govuk_app_config.rb @@ -8,7 +8,7 @@ require "govuk_app_config/configure" if defined?(Rails) - require "govuk_app_config/railtie" require "govuk_app_config/govuk_logging" require "govuk_app_config/govuk_content_security_policy" + require "govuk_app_config/railtie" end