Since query_result method is the same, use inheritance

This commit is contained in:
Jean-Baptiste Bellet
2022-06-07 10:36:40 +02:00
parent f548afba3e
commit 2c2c48071d
4 changed files with 6 additions and 18 deletions

View File

@@ -21,6 +21,12 @@ module Reporting
report_line_items.orders
end
def query_result
report_line_items.list(line_item_includes).group_by { |e|
[e.variant_id, e.price]
}.values
end
private
def order_permissions

View File

@@ -44,12 +44,6 @@ module Reporting
variant: [{ option_values: :option_type }, { product: :supplier }]
}]
end
def query_result
report_line_items.list(line_item_includes).group_by { |e|
[e.variant_id, e.price]
}.values
end
end
end
end

View File

@@ -35,12 +35,6 @@ module Reporting
def line_item_includes
[{ variant: [{ option_values: :option_type }, { product: :supplier }] }]
end
def query_result
report_line_items.list(line_item_includes).group_by { |e|
[e.variant_id, e.price]
}.values
end
end
end
end

View File

@@ -42,12 +42,6 @@ module Reporting
[{ order: :distributor,
variant: [{ option_values: :option_type }, { product: :supplier }] }]
end
def query_result
report_line_items.list(line_item_includes).group_by { |e|
[e.variant_id, e.price]
}.values
end
end
end
end