From 57f0d68c7ef5e7918c48cbee74173333129ecbfa Mon Sep 17 00:00:00 2001 From: Alessandro Desantis Date: Wed, 30 Sep 2020 15:26:16 +0200 Subject: Remove logging from dispatchers The way it is currently implemented, the default logging behavior from this extension could easily pollute the logs of large applications. Logging should be implemented by individual users if they need it. --- .../solidus_subscriptions/failure_dispatcher.rb | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'app/services/solidus_subscriptions/failure_dispatcher.rb') diff --git a/app/services/solidus_subscriptions/failure_dispatcher.rb b/app/services/solidus_subscriptions/failure_dispatcher.rb index 4fdb828..c77d4b0 100644 --- a/app/services/solidus_subscriptions/failure_dispatcher.rb +++ b/app/services/solidus_subscriptions/failure_dispatcher.rb @@ -1,21 +1,14 @@ # frozen_string_literal: true -# A handler for behaviour that should happen after installments are marked as -# failures +# Handles failed installments. module SolidusSubscriptions class FailureDispatcher < Dispatcher def dispatch - order.touch :completed_at + order.touch(:completed_at) order.cancel - installments.each { |i| i.failed!(order) } - super - end - - def message - " - Something went wrong processing installments: #{installments.map(&:id).join(', ')}. - They have been marked for reprocessing. - " + installments.each do |installment| + installment.failed!(order) + end end end end -- cgit v1.2.3