From 6c4ace8d14f23612cd44f5e91133859765adecb5 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 12 Aug 2013 14:02:55 +1000 Subject: [PATCH] Ensure that all PaymentMethod-derived classes also allow distributor_id --- app/models/spree/payment_method_decorator.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/spree/payment_method_decorator.rb b/app/models/spree/payment_method_decorator.rb index 1cff5f4611..f8759ac06b 100644 --- a/app/models/spree/payment_method_decorator.rb +++ b/app/models/spree/payment_method_decorator.rb @@ -13,4 +13,9 @@ Spree::PaymentMethod.class_eval do where('distributor_id IN (?)', user.enterprises.map {|enterprise| enterprise.id }) end } +end + +# Ensure that all derived classes also allow distributor_id +Spree::Gateway.providers.each do |p| + p.attr_accessible :distributor_id end \ No newline at end of file