mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-03 06:59:14 +00:00
Simplify #active_outgoing_variants
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user