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

Pass block to tap method

Oliver Günther6106d6bd5f58
diff --git a/app/services/service_result.rb b/app/services/service_result.rb
index 7fa8c50adc4..7a3342d720e 100644
--- a/app/services/service_result.rb
+++ b/app/services/service_result.rb
@@ -134,13 +134,13 @@ class ServiceResult
self.dependent_results += inner_results
end
- def on_success
- tap if success?
+ def on_success(&block)
+ tap(&block) if success?
self
end
- def on_failure
- tap if failure?
+ def on_failure(&block)
+ tap(&block) if failure?
self
end