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

Define a custom ProjectCustomField class in the migrations

Dombi Attila1adf0804f6d5
diff --git a/db/migrate/20231031133334_create_project_custom_field_project_mappings.rb b/db/migrate/20231031133334_create_project_custom_field_project_mappings.rb
index ff9580a45df..8e258b85b73 100644
--- a/db/migrate/20231031133334_create_project_custom_field_project_mappings.rb
+++ b/db/migrate/20231031133334_create_project_custom_field_project_mappings.rb
@@ -18,6 +18,8 @@ class CreateProjectCustomFieldProjectMappings < ActiveRecord::Migration[7.0]
private
+ class ProjectCustomField < CustomField; end
+
def create_default_mapping
project_ids = Project.pluck(:id)
custom_field_ids = ProjectCustomField.pluck(:id)