Mercurial > hg > soundsoftware-site
comparison extra/soundsoftware/get-statistics.rb @ 1454:02a05da0bedc luisf
Extracting also top-level project stats in script.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Thu, 07 Nov 2013 17:09:55 +0000 |
parents | b554eb79ec7b |
children |
comparison
equal
deleted
inserted
replaced
1453:b554eb79ec7b | 1454:02a05da0bedc |
---|---|
4 # Invoke with e.g. | 4 # Invoke with e.g. |
5 # | 5 # |
6 # ./script/rails runner -e production extra/soundsoftware/get-statistics.rb | 6 # ./script/rails runner -e production extra/soundsoftware/get-statistics.rb |
7 # | 7 # |
8 | 8 |
9 projectStats = {:all => Project.active.all.count, :private => Project.active.find(:all, :conditions => {:is_public => false}).count} | 9 projectStats = { |
10 :all => Project.active.all.count, | |
11 :private => Project.active.find(:all, :conditions => {:is_public => false}).count, | |
12 :top_level => Project.active.find(:all, :conditions => {:parent_id => nil}).count, | |
13 :top_level_and_private => Project.active.find(:all, :conditions => {:is_public => false, :parent_id => nil}).count | |
14 } | |
10 | 15 |
11 userStats = {:all => User.active.all.count} | 16 userStats = {:all => User.active.all.count} |
12 | 17 |
13 stats = {:date => Date.today, :projects => projectStats, :users => userStats}.to_json | 18 stats = {:date => Date.today, :projects => projectStats, :users => userStats}.to_json |
14 | 19 |