Skip to content

Commit

Permalink
Move method delegation from decorator to model
Browse files Browse the repository at this point in the history
  • Loading branch information
sauloperez committed Jun 26, 2020
1 parent a091ab2 commit 17170f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/models/spree/payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class Payment < ActiveRecord::Base

IDENTIFIER_CHARS = (('A'..'Z').to_a + ('0'..'9').to_a - %w(0 1 I O)).freeze

delegate :line_items, to: :order

belongs_to :order, class_name: 'Spree::Order'
belongs_to :source, polymorphic: true
belongs_to :payment_method, class_name: 'Spree::PaymentMethod'
Expand Down
2 changes: 0 additions & 2 deletions app/models/spree/payment_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

module Spree
Payment.class_eval do
delegate :line_items, to: :order

# 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
Expand Down

0 comments on commit 17170f0

Please sign in to comment.