Skip to content

Commit

Permalink
Merge pull request #18784 from lpichler/remove_miq_report_get_col_type
Browse files Browse the repository at this point in the history
Remove method get_col_type from MiqReport and its usages
  • Loading branch information
kbrock authored Jun 10, 2019
2 parents 3899308 + f92b8eb commit 2833125
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions app/models/miq_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,8 @@ def self.get_expressions_by_model(db)
reports.each_with_object({}) { |report, hash| hash[report.name] = report.id }
end

def self.get_col_type(path)
MiqExpression.get_col_type(path)
end

def self.get_col_info(path)
data_type = get_col_type(path)
data_type = parse_field_or_tag(path).try(:column_type)
{
:data_type => data_type,
:available_formats => get_available_formats(path, data_type),
Expand Down
2 changes: 1 addition & 1 deletion app/models/miq_report/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def date_time_break_suffixes
end

def get_col_break_suffixes(col)
col_type = get_col_type(col)
col_type = MiqExpression.parse_field_or_tag(col).try(:column_type)
case col_type
when :date
date_time_break_suffixes.select { |_name, suffix| !suffix.to_s.starts_with?("hour") }
Expand Down
2 changes: 1 addition & 1 deletion app/models/miq_report/generator/sorting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def build_sort_table
sb_nil_sub = []
new_sortby.each_with_index do |sb, idx|
base_col_name = sb.split(SORT_COL_SUFFIX).first
ctype = self.class.get_col_type(col_to_expression_col(base_col_name)) || :string
ctype = MiqExpression.parse_field_or_tag(col_to_expression_col(base_col_name)) || :string
sb_nil_sub[idx] = case ctype
when :string, :text, :boolean then "00ff".hex.chr # "\xFF"
when :integer, :fixnum, :decimal, :float then @table.data.collect { |d| d.data[sb] }.compact.max.to_i + 1
Expand Down

0 comments on commit 2833125

Please sign in to comment.