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
Fix projects.work_package_custom_fields association.
Pavel Balashovccec176b3f83
diff --git a/app/models/project.rb b/app/models/project.rbindex 5218f0063d5..8f20bb877c4 100644--- a/app/models/project.rb+++ b/app/models/project.rb@@ -79,13 +79,10 @@ class Project < ApplicationRecordhas_many :changesets, through: :repositoryhas_one :wiki, dependent: :destroy# Custom field for the project's work_packages- has_many :custom_fields_projects,- dependent: :destroy- has_many :work_package_custom_fields,- -> { order("#{CustomField.table_name}.position") },- through: :custom_fields_projects,- class_name: 'WorkPackageCustomField',- source: :custom_field+ has_and_belongs_to_many :work_package_custom_fields,+ -> { order("#{CustomField.table_name}.position") },+ join_table: :custom_fields_projects,+ association_foreign_key: 'custom_field_id'has_one :status, class_name: 'Projects::Status', dependent: :destroyhas_many :budgets, dependent: :destroyhas_many :notification_settings, dependent: :destroy@@ -319,7 +316,7 @@ class Project < ApplicationRecordenddef enabled_module_names=(module_names)- if module_names&.is_a?(Array)+ if module_names.is_a?(Array)module_names = module_names.map(&:to_s).compact_blankself.enabled_modules = module_names.map do |name|enabled_modules.detect do |mod|