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

Replace conditional check with on_success block

Mir Bhatiad8640c120536
diff --git a/app/services/work_packages/bulk/copy_service.rb b/app/services/work_packages/bulk/copy_service.rb
index 394fd06b397..ff7fb8583f4 100644
--- a/app/services/work_packages/bulk/copy_service.rb
+++ b/app/services/work_packages/bulk/copy_service.rb
@@ -58,7 +58,10 @@ module WorkPackages
wp_map.store(work_package.id, wp_copy.result.id)
end
- copy_relations unless result.failure?
+ result.on_success do
+ copy_relations
+ end
+
result.result = false if result.failure?
result