From aa8523c8cf0a790ae8e074470d8e07a8f185cd22 Mon Sep 17 00:00:00 2001 From: "Matt K. Fu" Date: Tue, 27 Aug 2013 16:07:58 +0800 Subject: [PATCH] fix counter eval --- lib/orbit_app/module/visitor_counter_eval.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/orbit_app/module/visitor_counter_eval.rb b/lib/orbit_app/module/visitor_counter_eval.rb index 9d1e30584..373bc84e5 100644 --- a/lib/orbit_app/module/visitor_counter_eval.rb +++ b/lib/orbit_app/module/visitor_counter_eval.rb @@ -7,7 +7,7 @@ module OrbitApp map = "function(){ emit( this.referrer,{session_hash: this.session_hash,created_at: this.created_at}); };" reduce = "function(key, values){ var sum = 0; values.forEach(function(doc){sum += doc.amount; }); return {amount: sum};};" if options.blank? - impressions = Impression.count #collection.map_reduce(map, reduce,read: :primary, out: "vr") + impressions = Impression.collection.map_reduce(map, reduce,read: :primary, out: "vr") else query = Impression.where(options).selector impressions = Impression.where(options).collection.map_reduce(map, reduce,read: :primary, out: "vr",:query=>query)