Skip to content

Commit

Permalink
Merge skipped callback from decorator into model
Browse files Browse the repository at this point in the history
If we don't want that callback we can just as well remove it now that we
own that code.
  • Loading branch information
sauloperez committed Jul 10, 2020
1 parent 55d52b8 commit cf64d3a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
9 changes: 0 additions & 9 deletions app/models/spree/payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ class Payment < ActiveRecord::Base
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
Expand Down
10 changes: 0 additions & 10 deletions app/models/spree/payment_decorator.rb

This file was deleted.

0 comments on commit cf64d3a

Please sign in to comment.