Skip to content

Commit

Permalink
Revert "Merge pull request ManageIQ#17927 from lpichler/memoize_cols_…
Browse files Browse the repository at this point in the history
…on_metric_rollup"

This reverts commit 345a318, reversing
changes made to ac675f5.
  • Loading branch information
agrare committed Sep 12, 2018
1 parent 378577a commit 4e051f3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/models/chargeable_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def rate_name
end

def self.cols_on_metric_rollup
@cols_on_metric_rollup ||= begin
(%w(id tag_names resource_id) + chargeable_cols_on_metric_rollup).uniq
end
(%w(id tag_names resource_id) + chargeable_cols_on_metric_rollup).uniq
end

def self.col_index(column)
Expand Down Expand Up @@ -138,10 +136,8 @@ def self.seed_data
end

def self.chargeable_cols_on_metric_rollup
@chargeable_cols_on_metric_rollup ||= begin
existing_cols = MetricRollup.attribute_names
chargeable_cols = pluck(:metric) & existing_cols
chargeable_cols.map! { |x| VIRTUAL_COL_USES[x] || x }.sort.uniq
end
existing_cols = MetricRollup.attribute_names
chargeable_cols = pluck(:metric) & existing_cols
chargeable_cols.map! { |x| VIRTUAL_COL_USES[x] || x }.sort
end
end

0 comments on commit 4e051f3

Please sign in to comment.