From c1111cee1010d2c97888295740e0affb14305bae Mon Sep 17 00:00:00 2001 From: lpichler Date: Mon, 17 Jul 2017 19:40:57 +0200 Subject: [PATCH] Fill unit only if we can determine unit from rates otherwise method ApplicationController.helpers.number_with_delimiter is called (thru apply_format_function and format_currency_with_delimiter is called) with parameters: ApplicationController.helpers.number_to_currency('0.0', {:unit => nil} ) which is causing error. --- app/models/miq_report/formatting.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/miq_report/formatting.rb b/app/models/miq_report/formatting.rb index 66b67c5a7ff..2f8fee41ca4 100644 --- a/app/models/miq_report/formatting.rb +++ b/app/models/miq_report/formatting.rb @@ -69,7 +69,7 @@ def format(col, value, options = {}) # Chargeback Reports: Add the selected currency in the assigned rate to options if Chargeback.db_is_chargeback?(db) @rates_cache ||= Chargeback::RatesCache.new - options[:unit] = @rates_cache.currency_for_report + options[:unit] = @rates_cache.currency_for_report if @rates_cache.currency_for_report end format.merge!(options) if format # Merge additional options that were passed in as overrides