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

Eager load CF available formats

Alexander2a6c19aede9e
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index 9fc37427bde..f7f14818323 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -66,7 +66,7 @@ class CustomField < ApplicationRecord
errors.add(:name, :taken) if name.in?(taken_names)
end
- validates :field_format, inclusion: { in: OpenProject::CustomFieldFormat.available_formats }
+ validates :field_format, inclusion: { in: -> { OpenProject::CustomFieldFormat.available_formats } }
validate :validate_default_value
validate :validate_regex