Fix visitor count. Mapping the session and making sure they were unique using rails was way slower than doing it with a mongoid query
This commit is contained in:
parent
b1d8a87256
commit
3a91c92bf7
|
@ -4,8 +4,7 @@ module OrbitApp
|
|||
Version = "0.1"
|
||||
|
||||
def display_visitors(options={})
|
||||
impressions = Impression.where(options).and(:referrer.ne => nil)
|
||||
impressions.map{|i| i[:session_hash]}.uniq.count
|
||||
impressions = Impression.where(options).and(:referrer.ne => nil).distinct(:session_hash).count
|
||||
end
|
||||
|
||||
def display_visitors_today
|
||||
|
|
Loading…
Reference in New Issue