mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Use Rails standard naming: same name for the route and the method
This commit is contained in:
@@ -9,8 +9,8 @@ module Spree
|
||||
helper CheckoutHelper
|
||||
|
||||
before_action :load_order, only: [:edit, :update, :fire, :resend,
|
||||
:invoice, :print, :set_distribution]
|
||||
before_action :load_distribution_choices, only: [:new, :edit, :update, :set_distribution]
|
||||
:invoice, :print, :distribution]
|
||||
before_action :load_distribution_choices, only: [:new, :edit, :update, :distribution]
|
||||
|
||||
before_action :require_distributor_abn, only: :invoice
|
||||
|
||||
@@ -24,7 +24,7 @@ module Spree
|
||||
redirect_to spree.distribution_admin_order_path(@order)
|
||||
end
|
||||
|
||||
def set_distribution
|
||||
def distribution
|
||||
return if order_params.blank?
|
||||
|
||||
on_update
|
||||
|
||||
@@ -274,7 +274,7 @@ module Spree
|
||||
# Enterprise User can access orders that are placed inside a OC they coordinate
|
||||
order.order_cycle&.coordinated_by?(user)
|
||||
end
|
||||
can [:admin, :bulk_management, :managed, :set_distribution], Spree::Order do
|
||||
can [:admin, :bulk_management, :managed, :distribution], Spree::Order do
|
||||
user.admin? || user.enterprises.any?(&:is_distributor)
|
||||
end
|
||||
can [:admin, :create, :show, :poll], :invoice
|
||||
|
||||
@@ -89,8 +89,8 @@ Spree::Core::Engine.routes.draw do
|
||||
post :resend
|
||||
get :invoice
|
||||
get :print
|
||||
get :distribution, to: 'orders#set_distribution'
|
||||
put :distribution, to: 'orders#set_distribution'
|
||||
get :distribution
|
||||
put :distribution
|
||||
end
|
||||
|
||||
collection do
|
||||
|
||||
Reference in New Issue
Block a user