mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
before_filters for enterprise controller are run in the correct order, and put inside the shop action
This commit is contained in:
@@ -2,9 +2,6 @@ class EnterprisesController < BaseController
|
||||
layout "darkswarm"
|
||||
helper Spree::ProductsHelper
|
||||
include OrderCyclesHelper
|
||||
before_filter :require_distributor_chosen
|
||||
before_filter :set_order_cycles, only: :shop
|
||||
before_filter :load_active_distributors, only: :shop
|
||||
before_filter :clean_permalink, only: :check_permalink
|
||||
|
||||
respond_to :js, only: :permalink_checker
|
||||
@@ -73,6 +70,10 @@ class EnterprisesController < BaseController
|
||||
order_cycle_options = OrderCycle.active.with_distributor(distributor)
|
||||
order.order_cycle = order_cycle_options.first if order_cycle_options.count == 1
|
||||
order.save!
|
||||
|
||||
require_distributor_chosen
|
||||
set_order_cycles
|
||||
load_active_distributors
|
||||
end
|
||||
|
||||
def check_permalink
|
||||
|
||||
Reference in New Issue
Block a user