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

use separate accessors instead of checking field_format against list in CustomField#multi_value_possible?

Ivan Kuchin0b859db58ac9
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index 19b625c91d7..076d972709d 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -268,6 +268,10 @@ class CustomField < ApplicationRecord
field_format == "list"
end
+ def user?
+ field_format == "user"
+ end
+
def version?
field_format == "version"
end
@@ -281,7 +285,7 @@ class CustomField < ApplicationRecord
end
def multi_value_possible?
- %w[version user list].include?(field_format)
+ version? || user? || list?
end
def allow_non_open_versions_possible?