Skip to content

Commit

Permalink
Metric modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
astudnev committed Feb 22, 2020
1 parent 78a0c2b commit e406828
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/activecube/query/cube_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def reduced other_measures
reduced_selectors = self.selectors
else
reduced_measures = other_measures.collect{|m|
Measure.new m.cube, m.key, m.definition, (m.selectors - common_selectors)
Measure.new m.cube, m.key, m.definition, (m.selectors - common_selectors), m.modifications
}
reduced_selectors = self.selectors + common_selectors
end
Expand Down
4 changes: 2 additions & 2 deletions lib/activecube/query/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Activecube::Query
class Measure < Item
attr_reader :selectors, :modifications

def initialize cube, key, definition, modifications = [], selectors = []
def initialize cube, key, definition, selectors = [], modifications = []
super cube, key, definition
@selectors = selectors
@modifications = modifications
Expand All @@ -22,7 +22,7 @@ def when *args
end

def alias! new_key
self.class.new cube, new_key, definition, modifications, selectors
self.class.new cube, new_key, definition, selectors, modifications
end

def condition_query arel_table, cube_query
Expand Down

0 comments on commit e406828

Please sign in to comment.