lib/the_help/service.rb in the_help-3.3.0 vs lib/the_help/service.rb in the_help-3.3.1

- old
+ new

@@ -322,16 +322,18 @@ "as #{context.inspect}") result.error run_callback(not_authorized, service: self.class, context: context) stop! end - def stop!(type: :error, value: nil) - if value.nil? - check_result! - elsif type == :success - result.success value + def stop!(type: :error, **opts) + if opts.has_key?(:value) + if type == :success + result.success value + else + result.error value + end else - result.error value + check_result! end throw :stop end def check_result!