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
Don't add to errors manually
Oliver Güntherb26a7bdbfa19
diff --git a/app/models/custom_option.rb b/app/models/custom_option.rbindex ec3bd982a78..157cec14918 100644--- a/app/models/custom_option.rb+++ b/app/models/custom_option.rb@@ -49,7 +49,7 @@ class CustomOption < ApplicationRecorddef assure_at_least_one_optionreturn if CustomOption.where(custom_field_id: custom_field_id).where.not(id: id).count > 0- errors[:base] << I18n.t(:'activerecord.errors.models.custom_field.at_least_one_custom_option')+ errors.add(:base, I18n.t(:'activerecord.errors.models.custom_field.at_least_one_custom_option'))throw :abortenddiff --git a/modules/pdf_export/app/models/export_card_configuration.rb b/modules/pdf_export/app/models/export_card_configuration.rbindex fbb734b363c..532587d7892 100644--- a/modules/pdf_export/app/models/export_card_configuration.rb+++ b/modules/pdf_export/app/models/export_card_configuration.rb@@ -69,11 +69,11 @@ class ExportCardConfiguration < ApplicationRecorddef validate(record)beginif record.rows.nil? || !(YAML::load(record.rows)).is_a?(Hash)- record.errors[:rows] << I18n.t('validation_error_yaml_is_badly_formed')+ record.errors.add(:rows, I18n.t('validation_error_yaml_is_badly_formed'))return falseendrescue Psych::SyntaxError => e- record.errors[:rows] << I18n.t('validation_error_yaml_is_badly_formed')+ record.errors.add(:rows, I18n.t('validation_error_yaml_is_badly_formed'))return falseend@@ -92,7 +92,7 @@ class ExportCardConfiguration < ApplicationRecordendendrescue ArgumentError => e- record.errors[:rows] << "#{I18n.t('yaml_error')} #{e.message}"+ record.errors.add(:rows, "#{I18n.t('yaml_error')} #{e.message}")endendend