before_filters for enterprise controller are run in the correct order, and put inside the shop action

This commit is contained in:
Rob Harrington
2015-01-20 16:19:01 +11:00
parent 60313f7a6a
commit 4baa205cf9

View File

@@ -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