mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Reports: use field name as header instead of translated value for raw renders (csv, json)
This commit is contained in:
committed by
Jean-Baptiste Bellet
parent
0218f75f34
commit
2008c10c6f
@@ -29,6 +29,8 @@ module Reporting
|
||||
private
|
||||
|
||||
def translate_header(key)
|
||||
return key.to_s if report.raw_render?
|
||||
|
||||
# Quite some headers use currency interpolation, so providing it by default
|
||||
default_params = { currency: currency_symbol, currency_symbol: currency_symbol }
|
||||
report.custom_headers[key] || I18n.t("report_header_#{key}", **default_params)
|
||||
|
||||
@@ -79,7 +79,7 @@ module Reporting
|
||||
end
|
||||
|
||||
describe "fields_to_hide" do
|
||||
let(:params) { { fields_to_hide: [:product], report_format: 'json' } }
|
||||
let(:params) { { fields_to_hide: [:product] } }
|
||||
|
||||
it "works" do
|
||||
@expected_headers = ['Hub', 'Price']
|
||||
|
||||
Reference in New Issue
Block a user