From e406828652bc323c092663eb11ffb3bd8643232a Mon Sep 17 00:00:00 2001 From: astudnev Date: Sat, 22 Feb 2020 14:10:01 +0300 Subject: [PATCH] Metric modifiers --- lib/activecube/query/cube_query.rb | 2 +- lib/activecube/query/measure.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/activecube/query/cube_query.rb b/lib/activecube/query/cube_query.rb index 8765923..15bfd8c 100644 --- a/lib/activecube/query/cube_query.rb +++ b/lib/activecube/query/cube_query.rb @@ -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 diff --git a/lib/activecube/query/measure.rb b/lib/activecube/query/measure.rb index 0c27b7a..ecf0a42 100644 --- a/lib/activecube/query/measure.rb +++ b/lib/activecube/query/measure.rb @@ -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 @@ -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