Skip to content

Commit

Permalink
#756 extend dimension/metric with configuration's
Browse files Browse the repository at this point in the history
  • Loading branch information
itayw committed Nov 1, 2015
1 parent 6250719 commit b56d578
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/dispatch/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ manager.parseDimension = function(context, d, callback) {
key: d
};
}
//if this is a computed dimension, simply pass it on
if (!d.dependsOn)
d.dependsOn = d.key;
if (!d.name)
d.name = d.key;

d.collection = d.collection || context.query.collection;
//let's find the metric
if (d.collection) {
Expand All @@ -147,6 +141,11 @@ manager.parseDimension = function(context, d, callback) {
if (err)
return callback(err);

d = ce.extend(collection[d.key], d);

This comment has been minimized.

Copy link
@itayw

itayw Nov 3, 2015

Author Member

This causes unexpected issues, haven't had time to look into this, but removing the extension corrects the issue. same for metric.

if (!d.dependsOn)
d.dependsOn = d.key;
if (!d.name)
d.name = d.key;
col = collection[d.dependsOn] ? collection : null;

if (!col && d.dependsOn.indexOf('.') > -1) {
Expand Down Expand Up @@ -215,8 +214,6 @@ manager.parseMetric = function(context, m, callback) {
m.collection = m.collection || context.query.collection;
if (!m.key && m.dependsOn)
m.key = m.dependsOn;
if (!m.dependsOn)
m.dependsOn = m.key;
//if (!m.name)
// m.name = m.key;

Expand All @@ -228,7 +225,11 @@ manager.parseMetric = function(context, m, callback) {
return callback(err);

col = collection[m.dependsOn] ? collection : null;

m = ce.extend(collection[m.key], m);
if (!d.dependsOn)
m.dependsOn = m.key;
if (!m.name)
m.name = m.key;
if (!col && m.dependsOn.indexOf('.') > -1) {
//let's see if we're dealing with a compound key
if (joola.common.checkNested(collection, m.dependsOn)) {
Expand Down

0 comments on commit b56d578

Please sign in to comment.