Fix code climate violations in removal of Blockenspiel dependency.

This commit is contained in:
Cillian O'Ruanaidh
2020-06-05 10:13:06 +01:00
parent d02f64da06
commit d436d18d19
3 changed files with 10 additions and 8 deletions

View File

@@ -153,7 +153,7 @@ module OpenFoodNetwork
line_items.map(&:order).uniq.sum(&:payment_total)
end
def empty_cell(line_items)
def empty_cell(*)
""
end
@@ -211,12 +211,12 @@ module OpenFoodNetwork
remainder >= 0 ? remainder : ''
end
def scaled_final_weight_volume(li)
(li.final_weight_volume || 0) / (li.product.variant_unit_scale || 1)
def scaled_final_weight_volume(line_item)
(line_item.final_weight_volume || 0) / (line_item.product.variant_unit_scale || 1)
end
def scaled_unit_value(v)
(v.unit_value || 0) / (v.product.variant_unit_scale || 1)
def scaled_unit_value(variant)
(variant.unit_value || 0) / (variant.product.variant_unit_scale || 1)
end
def total_amount(line_items)
@@ -235,7 +235,7 @@ module OpenFoodNetwork
line_items.sum(&:quantity)
end
def total_label(line_items)
def total_label(*)
I18n.t('admin.reports.total')
end

View File

@@ -1,6 +1,6 @@
module OpenFoodNetwork
class OrderGrouper
def initialize(rules, column_constructors, report=nil)
def initialize(rules, column_constructors, report = nil)
@rules = rules
@column_constructors = column_constructors
@report = report
@@ -62,7 +62,7 @@ module OpenFoodNetwork
def build_cell(column_constructor, items)
if column_constructor.is_a?(Symbol)
@report.send(column_constructor, items)
@report.__send__(column_constructor, items)
else
column_constructor.call(items)
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module OpenFoodNetwork::Reports
class BulkCoopAllocationReport
def header