diff --git a/app/controllers/base_controller.rb b/app/controllers/base_controller.rb index 952c66afee..f235694085 100644 --- a/app/controllers/base_controller.rb +++ b/app/controllers/base_controller.rb @@ -22,12 +22,8 @@ class BaseController < ApplicationController end # Default to the only order cycle if there's only one - # - # Here we need to use @order_cycles.size not @order_cycles.count - # because OrderCyclesList returns a modified ActiveRecord::Relation - # and these modifications are not seen if it is reloaded with count def set_order_cycle - return if @order_cycles.size != 1 + return if @order_cycles.count != 1 current_order(true).set_order_cycle! @order_cycles.first end