Mercurial > hg > soundsoftware-site
changeset 974:b2e0731c5438 live
Merge from get_statistics branch
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 19 Oct 2012 17:24:40 +0100 |
parents | 710921c48f06 (current diff) 30040a8e3a88 (diff) |
children | 510a66cccf79 |
files | |
diffstat | 1 files changed, 5 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/extra/soundsoftware/get-statistics.rb Fri Oct 19 14:47:53 2012 +0100 +++ b/extra/soundsoftware/get-statistics.rb Fri Oct 19 17:24:40 2012 +0100 @@ -38,41 +38,22 @@ weeks << end_date end - -users = [] # dates = months_between(d1, d2) dates = weeks_between(d1, d2) -private_projects = [] -all_projects = [] -public_projects = [] -top_level_and_private_projects = [] - dates.each do |date| - users << User.find(:all, :conditions => {:created_on => d1..date}) - all_projects << Project.find(:all, :conditions => {:created_on => d1..date}) - private_projects << Project.find(:all, :conditions => {:created_on => d1..date, + users = User.find(:all, :conditions => {:created_on => d1..date}) + all_projects = Project.find(:all, :conditions => {:created_on => d1..date}) + private_projects = Project.find(:all, :conditions => {:created_on => d1..date, :is_public => false}) - top_level_and_private_projects << Project.find(:all, :conditions => {:created_on => d1..date, + top_level_and_private_projects = Project.find(:all, :conditions => {:created_on => d1..date, :is_public => false, :parent_id => nil}) - puts "#{date} #{users.size} #{all_projects.size} #{private_projects.size} \n" + puts "#{date} #{users.count} #{all_projects.count} #{private_projects.count} #{top_level_and_private_projects.count}\n" end - - - - -#nusers.each_with_index do |num, idx| -# puts "#{dates[idx]} #{num}\n" -#end - - - - -