Extract CableCar responses code to a concern

This commit is contained in:
Matt-Yorkley
2021-08-16 11:11:05 +01:00
parent 5ef34347a3
commit 8bf3f72ad3
2 changed files with 16 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
# frozen_string_literal: true
module CablecarResponses
extend ActiveSupport::Concern
included do
include CableReady::Broadcaster
end
private
def partial(path, options = {})
{ html: render_to_string(partial: path, **options) }
end
end

View File

@@ -8,7 +8,7 @@ class SplitCheckoutController < ::BaseController
include OrderStockCheck
include Spree::BaseHelper
include CheckoutCallbacks
include CableReady::Broadcaster
include CablecarResponses
helper 'terms_and_conditions'
helper 'checkout'
@@ -36,10 +36,6 @@ class SplitCheckoutController < ::BaseController
private
def partial(path, options = {})
{ html: render_to_string(partial: path, **options) }
end
def clear_invalid_payments
@order.payments.with_state(:invalid).delete_all
end