Skip to content

Commit

Permalink
Don't format chargeback rate column in MiqReport::Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Feb 5, 2019
1 parent 5810a00 commit bad74a9
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 bad74a9

Please sign in to comment.