mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix rubocop issues in customer details controller and update rubocop manual todo accordingly
This commit is contained in:
@@ -360,8 +360,8 @@ Metrics/AbcSize:
|
||||
- app/controllers/enterprises_controller.rb
|
||||
- app/controllers/spree/admin/adjustments_controller_decorator.rb
|
||||
- app/controllers/spree/admin/image_settings_controller.rb
|
||||
- app/controllers/spree/admin/orders/customer_details_controller_decorator.rb
|
||||
- app/controllers/spree/admin/orders_controller_decorator.rb
|
||||
- app/controllers/spree/admin/orders/customer_details_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/overview_controller.rb
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
@@ -565,7 +565,8 @@ Metrics/MethodLength:
|
||||
- app/controllers/checkout_controller.rb
|
||||
- app/controllers/shop_controller.rb
|
||||
- app/controllers/spree/admin/image_settings_controller.rb
|
||||
- app/controllers/spree/admin/orders/customer_details_controller_decorator.rb
|
||||
- app/controllers/spree/admin/orders/customer_details_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
- app/controllers/spree/admin/reports_controller.rb
|
||||
@@ -652,6 +653,7 @@ Metrics/ClassLength:
|
||||
- app/controllers/api/products_controller.rb
|
||||
- app/controllers/checkout_controller.rb
|
||||
- app/controllers/spree/admin/base_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/reports_controller.rb
|
||||
- app/controllers/spree/admin/resource_controller.rb
|
||||
|
||||
@@ -8,13 +8,13 @@ module Spree
|
||||
|
||||
def show
|
||||
edit
|
||||
render :action => :edit
|
||||
render action: :edit
|
||||
end
|
||||
|
||||
def edit
|
||||
country_id = Address.default.country.id
|
||||
@order.build_bill_address(:country_id => country_id) if @order.bill_address.nil?
|
||||
@order.build_ship_address(:country_id => country_id) if @order.ship_address.nil?
|
||||
@order.build_bill_address(country_id: country_id) if @order.bill_address.nil?
|
||||
@order.build_ship_address(country_id: country_id) if @order.ship_address.nil?
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -25,7 +25,7 @@ module Spree
|
||||
|
||||
AdvanceOrderService.new(@order).call
|
||||
|
||||
@order.shipments.map &:refresh_rates
|
||||
@order.shipments.map(&:refresh_rates)
|
||||
flash[:success] = Spree.t('customer_details_updated')
|
||||
redirect_to admin_order_customer_path(@order)
|
||||
else
|
||||
@@ -42,7 +42,7 @@ module Spree
|
||||
private
|
||||
|
||||
def load_order
|
||||
@order = Order.find_by_number!(params[:order_id], :include => :adjustments)
|
||||
@order = Order.find_by_number!(params[:order_id], include: :adjustments)
|
||||
end
|
||||
|
||||
def check_authorization
|
||||
@@ -62,6 +62,7 @@ module Spree
|
||||
params[:order][:guest_checkout] = registered_user.nil?
|
||||
|
||||
return unless registered_user
|
||||
|
||||
@order.user_id = registered_user.id
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user