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

Fix WorkPackageCustomField -> WrokPackages association

Klaus Zanders751853b61607
diff --git a/app/models/work_package_custom_field.rb b/app/models/work_package_custom_field.rb
index 850d730ebc5..0986fd5955b 100644
--- a/app/models/work_package_custom_field.rb
+++ b/app/models/work_package_custom_field.rb
@@ -34,7 +34,9 @@ class WorkPackageCustomField < CustomField
join_table: "#{table_name_prefix}custom_fields_types#{table_name_suffix}",
foreign_key: 'custom_field_id'
has_many :work_packages,
- through: :work_package_custom_values
+ through: :custom_values,
+ source: :customized,
+ source_type: "WorkPackage"
scope :visible_by_user, ->(user) {
if user.allowed_to_globally?(:select_custom_fields)