Skip to content

Commit

Permalink
Optimize load_order_statuses method
Browse files Browse the repository at this point in the history
  • Loading branch information
diebas committed Dec 2, 2024
1 parent 2c44b0b commit 1857008
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/order_management/order_details_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def load_order_statuses
return if @order_detail.reconciled?

if @order_detail.complete?
@order_statuses = [OrderStatus.complete, OrderStatus.canceled, OrderStatus.unrecoverable]
@order_statuses << OrderStatus.reconciled if @order_detail.can_reconcile?
@order_statuses = OrderStatus.where(name: %w[complete canceled unrecoverable reconciled]).to_a
@order_statuses.reject! { |status| status.name == 'reconciled' } unless @order_detail.can_reconcile?
elsif @order_detail.order_status.root == OrderStatus.canceled
@order_statuses = OrderStatus.canceled_statuses_for_facility(current_facility)
else
Expand Down

0 comments on commit 1857008

Please sign in to comment.