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

extract CustomFieldFormat#available?

Ivan Kuchin88e705d7ec54
diff --git a/lib/open_project/custom_field_format.rb b/lib/open_project/custom_field_format.rb
index dc2c8440465..b8edca8294f 100644
--- a/lib/open_project/custom_field_format.rb
+++ b/lib/open_project/custom_field_format.rb
@@ -65,6 +65,10 @@ module OpenProject
Kernel.const_get(@formatter)
end
+ def available?
+ enabled? && enterprise_feature_allowed?
+ end
+
def enabled?
@enabled.call
end
@@ -89,7 +93,7 @@ module OpenProject
def available
registered.select do |_, format|
- format.enabled? && format.enterprise_feature_allowed?
+ format.available?
end
end