Skip to content

Commit

Permalink
GovukLogging is required before Railtie
Browse files Browse the repository at this point in the history
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 `<top (required)>'
/Users/kevindew/govuk/govuk_publishing_components/spec/dummy/config/environment.rb:5:in `<top (required)>'
/Users/kevindew/govuk/govuk_publishing_components/Rakefile:18:in `block (2 levels) in <top (required)>'
```

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.
  • Loading branch information
kevindew authored Oct 3, 2019
1 parent f07cffa commit 45d1f12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/govuk_app_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 45d1f12

Please sign in to comment.