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
[#59765] added scope for custom fields
Eric Schubertfc165bffca05
diff --git a/app/models/custom_actions/actions/custom_field.rb b/app/models/custom_actions/actions/custom_field.rbindex 2406a08cb22..374b3406218 100644--- a/app/models/custom_actions/actions/custom_field.rb+++ b/app/models/custom_actions/actions/custom_field.rb@@ -49,8 +49,7 @@ class CustomActions::Actions::CustomField < CustomActions::Actions::Basedef self.allWorkPackageCustomField- .where.not(field_format: %w(hierarchy))- .order(:name)+ .usable_as_custom_action.map do |cf|create_subclass(cf)enddiff --git a/app/models/work_package_custom_field.rb b/app/models/work_package_custom_field.rbindex 1b1a68fe5bc..0c1776abe2a 100644--- a/app/models/work_package_custom_field.rb+++ b/app/models/work_package_custom_field.rb@@ -49,6 +49,11 @@ class WorkPackageCustomField < CustomFieldend}+ scope :usable_as_custom_action, -> {+ where.not(field_format: %w[hierarchy])+ order(:name)+ }+def self.summablewhere(field_format: %w[int float])enddiff --git a/spec/models/custom_actions/actions/custom_field_spec.rb b/spec/models/custom_actions/actions/custom_field_spec.rbindex e8cea930e9a..05c68c59438 100644--- a/spec/models/custom_actions/actions/custom_field_spec.rb+++ b/spec/models/custom_actions/actions/custom_field_spec.rb@@ -98,7 +98,7 @@ RSpec.describe CustomActions::Actions::CustomField dodescribe ".all" dobefore doallow(WorkPackageCustomField)- .to receive(:order)+ .to receive(:usable_as_custom_action).and_return(custom_fields)end