Skip to content

Commit

Permalink
Merge pull request #67 from alphagov/msw/bad
Browse files Browse the repository at this point in the history
Inline GovukAppConfig::Railtie#enable_railtie_for?
  • Loading branch information
barrucadu authored Jan 4, 2019
2 parents 10c8f73 + bd4c5d7 commit 74343e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 70 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Fix crash on start due to incorrect method invocation.

# 1.11.1

* Fix crash on start due to incorrect method invocation.
Expand Down
8 changes: 2 additions & 6 deletions lib/govuk_app_config/railtie.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
module GovukAppConfig
class Railtie < Rails::Railtie
def self.enable_railtie_for?(name)
Rails.env.production? && !ENV.has_key?("GOVUK_APP_CONFIG_DISABLE_#{name.upcase}")
end

initializer('govuk_app_config') do |app|
GovukXRay.initialize(app) if self.enable_railtie_for?('xray')
GovukXRay.initialize(app) if Rails.env.production? && !ENV.has_key?("GOVUK_APP_CONFIG_DISABLE_XRAY")
end

config.before_initialize do
GovukLogging.configure if Rails.env.production?
end

config.after_initialize do
GovukXRay.start if self.enable_railtie_for?('xray')
GovukXRay.start if Rails.env.production? && !ENV.has_key?("GOVUK_APP_CONFIG_DISABLE_XRAY")
end
end
end
64 changes: 0 additions & 64 deletions spec/lib/railtie_spec.rb

This file was deleted.

0 comments on commit 74343e4

Please sign in to comment.