Skip to content

Commit

Permalink
Merge pull request #18431 from lpichler/dont_format_rate_column
Browse files Browse the repository at this point in the history
Don't format chargeback rate column in MiqReport::Formatting
  • Loading branch information
gtanzillo committed Feb 19, 2019
2 parents 574bb81 + bad74a9 commit 80bcb81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/chargeback.rb
Expand Up @@ -268,6 +268,10 @@ def self.default_column_for_format(col)
end
end

def self.rate_column?(col)
col.ends_with?("_rate")
end

private

def relevant_fields
Expand Down
2 changes: 2 additions & 0 deletions app/models/miq_report/formatting.rb
Expand Up @@ -37,6 +37,8 @@ def format(col, value, options = {})
end
end

# TODO: remove this and update storing column format to instance of report in UI (this requires migration)
options[:format] = :_none_ if Chargeback.db_is_chargeback?(db) && Chargeback.rate_column?(col.to_s)
col = Chargeback.default_column_for_format(col.to_s) if Chargeback.db_is_chargeback?(db)

format = options.delete(:format)
Expand Down

0 comments on commit 80bcb81

Please sign in to comment.