mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-03 06:59:14 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user