From 55883a0efc546e6980609179926f32f75281a36a Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Fri, 6 Sep 2019 15:55:41 +0200 Subject: [PATCH] Add implicit #bulk_management including filter OFN it's hard enough. No need to abuse implicitness making things very hard to follow. I've spent around 20min trying to find out where this controller action was implemented until I realized Rails renders the matching view if no controller action is defined. Making it git-greppable makes it a bit easier next time. --- app/controllers/spree/admin/orders_controller_decorator.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/spree/admin/orders_controller_decorator.rb b/app/controllers/spree/admin/orders_controller_decorator.rb index 5479c172b3..8483956024 100644 --- a/app/controllers/spree/admin/orders_controller_decorator.rb +++ b/app/controllers/spree/admin/orders_controller_decorator.rb @@ -3,7 +3,6 @@ require 'open_food_network/spree_api_key_loader' Spree::Admin::OrdersController.class_eval do include OpenFoodNetwork::SpreeApiKeyLoader helper CheckoutHelper - before_filter :load_spree_api_key, only: :bulk_management before_filter :load_order, only: %i[show edit update fire resend invoice print print_ticket] before_filter :load_distribution_choices, only: [:new, :edit, :update] @@ -27,6 +26,10 @@ Spree::Admin::OrdersController.class_eval do # within the page then fetches the data it needs from Api::OrdersController end + def bulk_management + load_spree_api_key + end + def edit @order.shipments.map &:refresh_rates