Skip to content

Commit b1f34da

Browse files
Add fallback for missing FF_ANALYTICS_ENABLED ENV var
1 parent abd7464 commit b1f34da

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/controllers/concerns/analyticable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ def record_page?
2020
end
2121

2222
def analytics_enabled?
23-
ENV.fetch('FF_ANALYTICS_ENABLED') == 'true'
23+
ENV.fetch('FF_ANALYTICS_ENABLED', false) == 'true'
2424
end
2525
end

config/initializers/active_analytics.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if ENV.fetch('FF_ANALYTICS_ENABLED') == 'true'
1+
if ENV.fetch('FF_ANALYTICS_ENABLED', false) == 'true'
22
Rails.application.configure do
33
ActiveAnalytics.base_controller_class = 'Admin::ApplicationController'
44

config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Rails.application.routes.draw do
22
mount MissionControl::Jobs::Engine, at: '/jobs'
3-
mount ActiveAnalytics::Engine, at: '/analytics' if ENV.fetch('FF_ANALYTICS_ENABLED') == 'true'
3+
mount ActiveAnalytics::Engine, at: '/analytics' if ENV.fetch('FF_ANALYTICS_ENABLED', false) == 'true'
44
mount LetterOpenerWeb::Engine, at: '/letter_opener' if Rails.env.development?
55

66
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

0 commit comments

Comments
 (0)