Skip to content

Commit

Permalink
Fix Ship Order Button: requested changes
Browse files Browse the repository at this point in the history
 - bypass rubocop class lines limit
  • Loading branch information
cyrillefr committed May 7, 2024
1 parent 37616c6 commit 9447b95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ Metrics/ClassLength:
- 'app/models/spree/user.rb'
- 'app/models/spree/variant.rb'
- 'app/models/spree/zone.rb'
- 'app/reflexes/admin/orders_reflex.rb'
- 'app/reflexes/products_reflex.rb'
- 'app/serializers/api/cached_enterprise_serializer.rb'
- 'app/serializers/api/enterprise_shopfront_serializer.rb'
Expand Down
7 changes: 2 additions & 5 deletions app/reflexes/admin/orders_reflex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def capture
def ship
@order.send_shipment_email = false unless params[:send_shipment_email]
if @order.ship
return set_param_for_controller if Regexp.union(Constants::PATHS).match? request.url
paths = %w[edit customer payments adjustments invoices return_authorizations].freeze
return set_param_for_controller if Regexp.union(paths).match? request.url

morph dom_id(@order), render(partial: "spree/admin/orders/table_row",
locals: { order: @order.reload, success: true })
Expand Down Expand Up @@ -134,8 +135,4 @@ def render_business_number_required_error(distributors)
morph_admin_flashes
end
end

module Constants
PATHS = %w[edit customer payments adjustments invoices return_authorizations].freeze
end
end

0 comments on commit 9447b95

Please sign in to comment.