-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from alphagov/msw/bad
Fix bad method invocation for enable_railtie_for?
- Loading branch information
Showing
2 changed files
with
8 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
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 enable_railtie_for?('xray') | ||
GovukXRay.initialize(app) if self.enable_railtie_for?('xray') | ||
end | ||
|
||
config.before_initialize do | ||
GovukLogging.configure if Rails.env.production? | ||
end | ||
|
||
config.after_initialize do | ||
GovukXRay.start if enable_railtie_for?('xray') | ||
end | ||
|
||
def self.enable_railtie_for?(name) | ||
Rails.env.production? && !ENV.has_key?("GOVUK_APP_CONFIG_DISABLE_#{name.upcase}") | ||
GovukXRay.start if self.enable_railtie_for?('xray') | ||
end | ||
end | ||
end |