mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Sort distribution choices by name
This commit is contained in:
@@ -117,7 +117,7 @@ Spree::Admin::OrdersController.class_eval do
|
||||
end
|
||||
|
||||
def load_distribution_choices
|
||||
@shops = Enterprise.is_distributor.managed_by(spree_current_user)
|
||||
@order_cycles = OrderCycle.managed_by(spree_current_user)
|
||||
@shops = Enterprise.is_distributor.managed_by(spree_current_user).by_name
|
||||
@order_cycles = OrderCycle.managed_by(spree_current_user).by_name
|
||||
end
|
||||
end
|
||||
|
||||
@@ -24,6 +24,8 @@ class OrderCycle < ActiveRecord::Base
|
||||
|
||||
scope :soonest_opening, lambda { upcoming.order('order_cycles.orders_open_at ASC') }
|
||||
|
||||
scope :by_name, order('name')
|
||||
|
||||
scope :distributing_product, lambda { |product|
|
||||
joins(:exchanges).
|
||||
merge(Exchange.outgoing).
|
||||
|
||||
Reference in New Issue
Block a user