Skip to content

Commit

Permalink
Merge pull request #17982 from agrare/revert_memoize_cols_on_metric_r…
Browse files Browse the repository at this point in the history
…ollup

Revert "Merge pull request #17927 from lpichler/memoize_cols_on_metri…
  • Loading branch information
gtanzillo authored Sep 12, 2018
2 parents 4173597 + 4e051f3 commit ec40830
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 ec40830

Please sign in to comment.