Move method delegation from decorator to model

This commit is contained in:
Pau Perez
2020-06-26 18:31:19 +02:00
parent cf6138da66
commit d49068ce66
2 changed files with 2 additions and 2 deletions

View File

@@ -7,6 +7,8 @@ module Spree
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'

View File

@@ -2,8 +2,6 @@ require 'spree/localized_number'
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