Mercurial > hg > soundsoftware-site
annotate extra/soundsoftware/get-statistics.rb @ 1524:82fac3dcf466 redmine-2.5-integration
Fix failure to interpret Javascript when autocompleting members for project
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Thu, 11 Sep 2014 10:24:38 +0100 |
parents | 02a05da0bedc |
children |
rev | line source |
---|---|
luis@970 | 1 |
luis@1453 | 2 # Log user and project information |
luis@1453 | 3 # |
luis@1453 | 4 # Invoke with e.g. |
luis@1453 | 5 # |
luis@1453 | 6 # ./script/rails runner -e production extra/soundsoftware/get-statistics.rb |
luis@970 | 7 # |
luis@970 | 8 |
luis@1454 | 9 projectStats = { |
luis@1454 | 10 :all => Project.active.all.count, |
luis@1454 | 11 :private => Project.active.find(:all, :conditions => {:is_public => false}).count, |
luis@1454 | 12 :top_level => Project.active.find(:all, :conditions => {:parent_id => nil}).count, |
luis@1454 | 13 :top_level_and_private => Project.active.find(:all, :conditions => {:is_public => false, :parent_id => nil}).count |
luis@1454 | 14 } |
luis@970 | 15 |
luis@1453 | 16 userStats = {:all => User.active.all.count} |
Chris@1002 | 17 |
luis@1453 | 18 stats = {:date => Date.today, :projects => projectStats, :users => userStats}.to_json |
Chris@1002 | 19 |
luis@1453 | 20 print "#{stats}\n" |
Chris@1002 | 21 |