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

Addresses feedback from @cbliard

Marcello Rochab4b50bd3f99b
diff --git a/db/migrate/20230808140921_add_derived_remaining_hours_to_work_packages.rb b/db/migrate/20230808140921_add_derived_remaining_hours_to_work_packages.rb
index 4a83882333e..793f18118fe 100644
--- a/db/migrate/20230808140921_add_derived_remaining_hours_to_work_packages.rb
+++ b/db/migrate/20230808140921_add_derived_remaining_hours_to_work_packages.rb
@@ -35,22 +35,17 @@ class AddDerivedRemainingHoursToWorkPackages < ActiveRecord::Migration[7.0]
reversible do |change|
change.up do
- WorkPackage.transaction do
- migrate_to_derived_remaining_hours!
- end
+ migrate_to_derived_remaining_hours!
end
change.down do
- WorkPackage.transaction do
- rollback_from_derived_remaining_hours!
- end
+ rollback_from_derived_remaining_hours!
end
end
end
def work_packages_to_update
- leaf_node_ids = WorkPackage.leaves.pluck(:id)
- WorkPackage.where.not(id: leaf_node_ids)
+ WorkPackage.where.not(id: WorkPackage.leaves)
end
def migrate_to_derived_remaining_hours!