Call @order_cycles.count instead of #size because TagRuleApplicator doesn't return Relation anymore

In March 2020 this was changed to use :size instead of :count because TagRuleApplicator returned an ActiveRecord::Relation, see:

d2eee1dafd

However in October 2020 TagRuleApplicator was changed to always return an Array so this is no longer needed, see:

7e606471e4
This commit is contained in:
Cillian O'Ruanaidh
2022-10-21 16:49:42 +01:00
parent 3e24b7ba6b
commit 7458dccea6

View File

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