mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-21 05:09:15 +00:00
Fix code climate violations in removal of Blockenspiel dependency.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module OpenFoodNetwork::Reports
|
||||
class BulkCoopAllocationReport
|
||||
def header
|
||||
|
||||
Reference in New Issue
Block a user