lib/the_help/service.rb in the_help-3.2.0 vs lib/the_help/service.rb in the_help-3.2.1
- old
+ new
@@ -261,19 +261,24 @@
# Executes the service and returns the result
#
# @return [TheHelp::Service::Result]
def call
validate_service_definition
+
catch(:stop) do
authorize
log_service_call
main
check_result!
- self.block_result = yield result if block_given?
end
+
+ self.block_result = yield result if block_given?
+
throw :stop if stop_caller
+
return block_result if block_given?
- return result
+
+ result
end
private
attr_accessor :context, :logger, :not_authorized, :block_result,