fix nil error if no proxy orders found

This commit is contained in:
Andy Brett
2020-11-20 10:32:48 -08:00
parent 5d93180081
commit 4e155641fc

View File

@@ -16,7 +16,7 @@ namespace :ofn do
# Reset Proxy Orders of the Order Cycle
# by detatching them from existing orders and resetting placed and confirmed dates
ProxyOrder.find_by(order_cycle_id: order_cycle_id).update(order_id: nil,
ProxyOrder.find_by(order_cycle_id: order_cycle_id)&.update(order_id: nil,
confirmed_at: nil,
placed_at: nil)