mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Payment Method must have one Distributor
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
Spree::PaymentMethod.class_eval do
|
Spree::PaymentMethod.class_eval do
|
||||||
belongs_to :distributor, :class_name => 'Enterprise'
|
belongs_to :distributor, :class_name => 'Enterprise'
|
||||||
|
|
||||||
|
validates_presence_of :distributor_id
|
||||||
|
|
||||||
attr_accessible :distributor_id
|
attr_accessible :distributor_id
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@
|
|||||||
= f.label :distributor
|
= f.label :distributor
|
||||||
%br
|
%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
|
= f.error_message_on :distributor
|
||||||
|
|||||||
Reference in New Issue
Block a user