From 887579ecb86abe64fa852b5903c4c56060f8a679 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Thu, 26 Mar 2015 22:41:10 +1100 Subject: [PATCH] Use managed_by scope on Enterprise instead of user.enterprises --- app/views/admin/order_cycles/_form.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admin/order_cycles/_form.html.haml b/app/views/admin/order_cycles/_form.html.haml index 489055459b..6d24e149f8 100644 --- a/app/views/admin/order_cycles/_form.html.haml +++ b/app/views/admin/order_cycles/_form.html.haml @@ -15,14 +15,14 @@ %tr.products{'ng-show' => 'exchange.showProducts'} = render 'exchange_supplied_products_form' -- if spree_current_user.enterprises.include? @order_cycle.coordinator +- if Enterprise.managed_by(spree_current_user).include? @order_cycle.coordinator = select_tag :new_supplier_id, options_for_select(permitted_producer_enterprise_options_for(@order_cycle)), {'ng-model' => 'new_supplier_id'} = f.submit 'Add supplier', 'ng-click' => 'addSupplier($event)' %h2 Coordinator --if spree_current_user.enterprises.include? @order_cycle.coordinator +-if Enterprise.managed_by(spree_current_user).include? @order_cycle.coordinator = f.label :coordinator_id, 'Coordinator' = f.select :coordinator_id, permitted_coordinating_enterprise_options_for(@order_cycle), { include_blank: true }, {'ng-model' => 'order_cycle.coordinator_id', 'ofn-on-change' => 'order_cycle.coordinator_fees = []', 'required' => true} = render 'coordinator_fees', f: f @@ -44,7 +44,7 @@ %tr.products{'ng-show' => 'exchange.showProducts'} = render 'exchange_distributed_products_form' -- if spree_current_user.enterprises.include? @order_cycle.coordinator +- if Enterprise.managed_by(spree_current_user).include? @order_cycle.coordinator = select_tag :new_distributor_id, options_for_select(permitted_hub_enterprise_options_for(@order_cycle)), {'ng-model' => 'new_distributor_id'} = f.submit 'Add distributor', 'ng-click' => 'addDistributor($event)'