From b3c56e6823c5804543f0ce199d076f4ee3cba511 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Sat, 13 Oct 2018 23:44:43 +0100 Subject: [PATCH] Duplicated payment method distributors association to gateway. This fixes the inheritance problem found in stripe gateway See PR 2780 for more details --- app/models/spree/gateway_decorator.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/spree/gateway_decorator.rb b/app/models/spree/gateway_decorator.rb index bc4312961e..75e17ffcaf 100644 --- a/app/models/spree/gateway_decorator.rb +++ b/app/models/spree/gateway_decorator.rb @@ -2,4 +2,7 @@ Spree::Gateway.class_eval do # Default to live preference :server, :string, :default => 'live' preference :test_mode, :boolean, :default => false + + attr_accessible :distributor_ids + has_and_belongs_to_many :distributors, join_table: 'distributors_payment_methods', :class_name => 'Enterprise', foreign_key: 'payment_method_id', association_foreign_key: 'distributor_id' end