]> git.openstreetmap.org Git - rails.git/commitdiff
Ignore traces which have not been inserted yet when calculating
authorTom Hughes <tom@compton.nu>
Thu, 15 Oct 2009 10:09:33 +0000 (10:09 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 15 Oct 2009 10:09:33 +0000 (10:09 +0000)
the per-user statistics.

script/statistics

index f04879359c4ac645d035daa0f5675887e78cbda6..afd5dd7d281c1a7b671cbc49596742e164e7014a 100755 (executable)
@@ -34,7 +34,7 @@ begin
     puts "<table>"
     puts "<tr><th>User</th><th>Number of Points</th></tr>"
 
-    Trace.sum(:size, :group => :user_id, :order => "sum_size DESC", :limit => 50).each do |user, count|
+    Trace.sum(:size, :conditions => { :inserted => true }, :group => :user_id, :order => "sum_size DESC", :limit => 50).each do |user, count|
       display_name = User.find(user).display_name.gsub('@', ' at ').gsub('.', ' dot ')
       puts "<tr><td><a href=\"/user/#{display_name}\">#{display_name}</a></td><td>#{count}</td></tr>"
     end