From cbe9d876885cdd961b00202eb52032795c42ac2f Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 3 Dec 2015 15:39:47 -0800 Subject: [PATCH 1/2] Remove silly broken assignment in spec This is trying to assign the payment's source to source. Not only is that the wrong thing to do (a payment is the source of a log_entry), but since it's being built through the payment.log_entries association, it will have no effect. Sometimes two wrongs do make a right! --- backend/spec/features/admin/orders/log_entries_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/spec/features/admin/orders/log_entries_spec.rb b/backend/spec/features/admin/orders/log_entries_spec.rb index aa7fc1698be..6db119e0a67 100644 --- a/backend/spec/features/admin/orders/log_entries_spec.rb +++ b/backend/spec/features/admin/orders/log_entries_spec.rb @@ -14,7 +14,6 @@ ) payment.log_entries.create( - :source => payment.source, :details => response.to_yaml ) end From bf3e2f89e250b5bb3c461943af58d19fed8428ee Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 21 Jan 2016 09:58:13 -0800 Subject: [PATCH 2/2] Remove after_rollback from LogEntry --- core/app/models/spree/log_entry.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/core/app/models/spree/log_entry.rb b/core/app/models/spree/log_entry.rb index 20797f02165..11d9e7a1771 100644 --- a/core/app/models/spree/log_entry.rb +++ b/core/app/models/spree/log_entry.rb @@ -2,17 +2,6 @@ module Spree class LogEntry < Spree::Base belongs_to :source, polymorphic: true - # Fix for https://github.com/spree/spree/issues/1767 - # If a payment fails, we want to make sure we keep the record of it failing - after_rollback :save_anyway - - def save_anyway - log = Spree::LogEntry.new - log.source = source - log.details = details - log.save! - end - def parsed_details @details ||= YAML.load(details) end