From a8fb9fd7015fd0e7d5338710d6c59725d20135e0 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 12 Jan 2023 19:35:26 +0100 Subject: [PATCH] Refactor render_theme method Co-Authored-By: Georg Gadinger --- app/helpers/theme_helper.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/helpers/theme_helper.rb b/app/helpers/theme_helper.rb index fd683786..3b3cf1e9 100644 --- a/app/helpers/theme_helper.rb +++ b/app/helpers/theme_helper.rb @@ -36,12 +36,8 @@ module ThemeHelper theme.attributes.each do |k, v| next unless ATTRIBUTE_MAP.key?(k) - if ATTRIBUTE_MAP[k].is_a?(Array) - ATTRIBUTE_MAP[k].each do |var| - body += "\t--#{var}: #{get_color_for_key(var, v)};\n" - end - else - body += "\t--#{ATTRIBUTE_MAP[k]}: #{get_color_for_key(ATTRIBUTE_MAP[k], v)};\n" + Array(ATTRIBUTE_MAP[k]).each do |var| + body += "\t--#{var}: #{get_color_for_key(var, v)};\n" end end body += "\t--turbolinks-progress-color: ##{lighten(theme.primary_color)}\n}"