From 63b20f404600c96ebf085951e6d74f7c566424a4 Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Thu, 26 Mar 2020 01:33:23 +0200 Subject: [PATCH] Add options to disable google calendar --- .env.development | 1 + .env.example | 1 + .env.test | 1 + app/helpers/application_helper.rb | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env.development b/.env.development index 95a7332..b5613d1 100644 --- a/.env.development +++ b/.env.development @@ -27,3 +27,4 @@ NEW_RELIC_LICENSE_KEY= GOOGLE_API_KEY= GOOGLE_CALENDAR_ID= +GOOGLE_CALENDAR=enabled \ No newline at end of file diff --git a/.env.example b/.env.example index 9ec022c..4e69e17 100644 --- a/.env.example +++ b/.env.example @@ -46,3 +46,4 @@ NEW_RELIC_LICENSE_KEY= GOOGLE_API_KEY= GOOGLE_CALENDAR_ID= +GOOGLE_CALENDAR=enabled \ No newline at end of file diff --git a/.env.test b/.env.test index df76ffc..c7fb3bd 100644 --- a/.env.test +++ b/.env.test @@ -34,3 +34,4 @@ OPENSSL_CONF=/etc/ssl/ GOOGLE_API_KEY= GOOGLE_CALENDAR_ID= +GOOGLE_CALENDAR=enabled \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 37831ab..541c2e2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -183,11 +183,11 @@ module ApplicationHelper end def upcoming_matches - calendar.upcoming || [] + ENV['GOOGLE_CALENDAR'] == "disabled" ? (calendar.upcoming || []) : [] end def upcoming_nsltv - calendar.upcoming_nsltv || [] + ENV['GOOGLE_CALENDAR'] == "disabled" ? (calendar.upcoming || []) : [] end def gathers_url