From: Tom Hughes Date: Fri, 25 Jul 2014 15:49:40 +0000 (+0100) Subject: More modernisations for the statistics script X-Git-Tag: live~4952 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/204486e824f0d2050a6fffce548d7191651e68c5 More modernisations for the statistics script --- diff --git a/script/statistics b/script/statistics index 315c6cd18..c5d401227 100755 --- a/script/statistics +++ b/script/statistics @@ -15,11 +15,11 @@ puts "

OpenStreetMap stats report run at #{start_time.to_s}

" begin ActiveRecord::Base.transaction do - user_count = User.count(:conditions => { :status => ["active", "confirmed", "suspended"] }) - tracepoint_count = Tracepoint.count() - node_count = Node.count(:conditions => "visible = true") - way_count = Way.count(:conditions => "visible = true") - relation_count = Relation.count(:conditions => "visible = true") + user_count = User.where(:status => ["active", "confirmed", "suspended"]).count + tracepoint_count = Tracepoint.count + node_count = Node.where(:visible => true).count + way_count = Way.where(:visible => true).count + relation_count = Relation.where(:visible => true).count puts "" puts ""
Number of users#{user_count}