mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-13 18:46:49 +00:00
Payment Method must have one Distributor
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
Spree::PaymentMethod.class_eval do
|
||||
belongs_to :distributor, :class_name => 'Enterprise'
|
||||
|
||||
validates_presence_of :distributor_id
|
||||
|
||||
attr_accessible :distributor_id
|
||||
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
= f.label :distributor
|
||||
%br
|
||||
|
||||
= collection_select(:payment_method, :distributor_id, Enterprise.is_distributor.managed_by(spree_current_user), :id, :name, {:include_blank => true}, {:class => "select2 fullwidth"})
|
||||
= collection_select(:payment_method, :distributor_id, Enterprise.is_distributor.managed_by(spree_current_user), :id, :name, {:include_blank => false}, {:class => "select2 fullwidth"})
|
||||
= f.error_message_on :distributor
|
||||
|
||||
Reference in New Issue
Block a user