From bbea00e43171180a71ba3e6f52f871e3dff80853 Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Thu, 10 Oct 2019 20:18:19 +0800 Subject: [PATCH] Delegate methods in Orders and Fulfillment report to report object --- .../orders_and_fulfillments_report.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/open_food_network/orders_and_fulfillments_report.rb b/lib/open_food_network/orders_and_fulfillments_report.rb index 6aa08bde7b..8cc3e4a064 100644 --- a/lib/open_food_network/orders_and_fulfillments_report.rb +++ b/lib/open_food_network/orders_and_fulfillments_report.rb @@ -11,6 +11,8 @@ module OpenFoodNetwork class OrdersAndFulfillmentsReport attr_reader :options, :report_type + delegate :header, :rules, :columns, to: :report + def initialize(permissions, options = {}, render_table = false) @options = options @report_type = options[:report_type] @@ -18,10 +20,6 @@ module OpenFoodNetwork @render_table = render_table end - def header - report.header - end - def search Reports::LineItems.search_orders(permissions, options) end @@ -31,16 +29,6 @@ module OpenFoodNetwork Reports::LineItems.list(permissions, options) end - def rules - report.rules - end - - # Returns a proc for each column displayed in each report type containing - # the logic to compute the value for each cell. - def columns - report.columns - end - private attr_reader :permissions