Simplify #active_outgoing_variants

This commit is contained in:
Matt-Yorkley
2019-10-22 21:58:43 +01:00
committed by luisramos0
parent 35b68239b0
commit ab30307b1a

View File

@@ -236,11 +236,7 @@ module OpenFoodNetwork
def active_outgoing_variants(hub)
@active_outgoing_variants ||= begin
active_variants = []
@order_cycle.exchanges.outgoing.where(receiver_id: hub).limit(1).each do |exchange|
active_variants = exchange.variants
end
active_variants
@order_cycle.exchanges.outgoing.where(receiver_id: hub).first.andand.variants || []
end
end