From c74d9fa735da02b19d16c1c087c3a9ee7cb00c40 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 2 May 2024 13:13:54 -0700 Subject: [PATCH] Don't crash in development if the Rails master key is missing Oops, right, this meta tag that runs on all pages currently crashes if we can't read the credentials file! Instead, let's just allow this value to be `nil` if not present. --- app/helpers/application_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d1f18758..587e020d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -101,7 +101,8 @@ module ApplicationHelper def impress_2020_meta_tags origin = Rails.configuration.impress_2020_origin - support_secret = Rails.application.credentials.impress_2020.support_secret + support_secret = Rails.application.credentials.dig( + :impress_2020, :support_secret) capture do concat tag("meta", name: "impress-2020-origin", content: origin)