mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Move method delegation from decorator to model
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user