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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#57388] provide default value to `true?`
Tobias Dillmannd12129c287f1
diff --git a/app/components/work_packages/exports/pdf/report/export_settings_component.html.erb b/app/components/work_packages/exports/pdf/report/export_settings_component.html.erbindex e56ce7c089e..a81056fb77f 100644--- a/app/components/work_packages/exports/pdf/report/export_settings_component.html.erb+++ b/app/components/work_packages/exports/pdf/report/export_settings_component.html.erb@@ -31,7 +31,7 @@<%= render(Primer::Alpha::CheckBox.new(name: "show_images",- checked: export_settings.settings.fetch(:show_images, true).to_s.to_bool,+ checked: export_settings.true?(:show_images, default: true),value: "true",unchecked_value: "false",label: I18n.t("export.dialog.pdf.include_images.label"),diff --git a/app/models/export_setting.rb b/app/models/export_setting.rbindex 1eee4a68dc4..3d04b7e9128 100644--- a/app/models/export_setting.rb+++ b/app/models/export_setting.rb@@ -51,8 +51,8 @@ class ExportSetting < ApplicationRecord# Some boolean settings are saved as string. Use this method to conveniently check if they are# set to true. Assumes that all boolean settings default to false.- def true?(key)- settings.fetch(key, false).to_s.to_bool+ def true?(key, default: false)+ settings.fetch(key, default).to_s.to_boolendprivate