Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#57655] Improve readability of SettingsHelper#setting_select

Tobias Dillmanne6cb193a21a9
diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb
index d4ad0a0c38e..33f22971aeb 100644
--- a/app/helpers/settings_helper.rb
+++ b/app/helpers/settings_helper.rb
@@ -33,8 +33,11 @@ module SettingsHelper
include OpenProject::FormTagHelper
def setting_select(setting, choices, options = {})
- if blank_text = options.delete(:blank)
- choices = [[blank_text.is_a?(Symbol) ? I18n.t(blank_text) : blank_text, ""]] + choices
+ blank_text = options.delete(:blank)
+
+ if blank_text
+ translated_blank = blank_text.is_a?(Symbol) ? I18n.t(blank_text) : blank_text
+ choices.unshift([translated_blank, ""])
end
setting_label(setting, options) +