Mercurial > hg > soundsoftware-site
comparison extra/soundsoftware/get-statistics.rb @ 973:30040a8e3a88 get_statistics
fixed counting of model figures
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 19 Oct 2012 17:19:21 +0100 |
parents | 6bd8364eafae |
children | 0befb332f41a |
comparison
equal
deleted
inserted
replaced
970:6bd8364eafae | 973:30040a8e3a88 |
---|---|
36 end | 36 end |
37 | 37 |
38 weeks << end_date | 38 weeks << end_date |
39 end | 39 end |
40 | 40 |
41 | |
42 users = [] | |
43 # dates = months_between(d1, d2) | 41 # dates = months_between(d1, d2) |
44 dates = weeks_between(d1, d2) | 42 dates = weeks_between(d1, d2) |
45 private_projects = [] | |
46 all_projects = [] | |
47 public_projects = [] | |
48 top_level_and_private_projects = [] | |
49 | |
50 | 43 |
51 dates.each do |date| | 44 dates.each do |date| |
52 users << User.find(:all, :conditions => {:created_on => d1..date}) | 45 users = User.find(:all, :conditions => {:created_on => d1..date}) |
53 all_projects << Project.find(:all, :conditions => {:created_on => d1..date}) | 46 all_projects = Project.find(:all, :conditions => {:created_on => d1..date}) |
54 private_projects << Project.find(:all, :conditions => {:created_on => d1..date, | 47 private_projects = Project.find(:all, :conditions => {:created_on => d1..date, |
55 :is_public => false}) | 48 :is_public => false}) |
56 top_level_and_private_projects << Project.find(:all, :conditions => {:created_on => d1..date, | 49 top_level_and_private_projects = Project.find(:all, :conditions => {:created_on => d1..date, |
57 :is_public => false, | 50 :is_public => false, |
58 :parent_id => nil}) | 51 :parent_id => nil}) |
59 | 52 |
60 puts "#{date} #{users.size} #{all_projects.size} #{private_projects.size} \n" | 53 puts "#{date} #{users.count} #{all_projects.count} #{private_projects.count} #{top_level_and_private_projects.count}\n" |
61 | 54 |
62 end | 55 end |
63 | 56 |
64 | 57 |
65 | 58 |
66 | 59 |
67 | |
68 | |
69 | |
70 | |
71 #nusers.each_with_index do |num, idx| | |
72 # puts "#{dates[idx]} #{num}\n" | |
73 #end | |
74 | |
75 | |
76 | |
77 | |
78 |