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 JoinPart patch after Active Record update

lavrika57380fa61b8
diff --git a/config/initializers/eager_load_with_hours.rb b/config/initializers/eager_load_with_hours.rb
index dcf00982633..943569f87bb 100644
--- a/config/initializers/eager_load_with_hours.rb
+++ b/config/initializers/eager_load_with_hours.rb
@@ -39,7 +39,9 @@ module OpenProject::Patches
module ActiveRecordJoinPartPatch
def instantiate(row, aliases)
if base_klass == WorkPackage && row.has_key?('hours')
- aliases_with_hours = aliases + [['hours', 'hours']]
+ aliases_with_hours = aliases + [
+ ActiveRecord::Associations::JoinDependency::Aliases::Column.new('hours', 'hours')
+ ]
super(row, aliases_with_hours)
else