Merge skipped callback from decorator into model

If we don't want that callback we can just as well remove it now that we
own that code.
This commit is contained in:
Pau Perez
2020-07-10 15:07:12 +02:00
parent 55d52b875f
commit cf64d3a290
2 changed files with 0 additions and 19 deletions

View File

@@ -41,15 +41,6 @@ module Spree
scope :failed, -> { with_state('failed') }
scope :valid, -> { where('state NOT IN (?)', %w(failed invalid)) }
after_rollback :persist_invalid
def persist_invalid
return unless ['failed', 'invalid'].include?(state)
state_will_change!
save
end
# order state machine (see http://github.com/pluginaweek/state_machine/tree/master for details)
state_machine initial: :checkout do
# With card payments, happens before purchase or authorization happens

View File

@@ -1,10 +0,0 @@
require 'spree/localized_number'
module Spree
Payment.class_eval do
# We bypass this after_rollback callback that is setup in Spree::Payment
# The issues the callback fixes are not experienced in OFN:
# if a payment fails on checkout the state "failed" is persisted correctly
def persist_invalid; end
end
end