Skip to content

Commit

Permalink
Fill unit only if we can determine unit from rates
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lpichler committed Jul 17, 2017
1 parent 604c5f9 commit c1111ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_report/formatting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c1111ce

Please sign in to comment.