]> git.openstreetmap.org Git - rails.git/commitdiff
Convert trace counting to use modern arel methods
authorTom Hughes <tom@compton.nu>
Sun, 29 Sep 2013 21:33:04 +0000 (22:33 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 29 Sep 2013 21:33:04 +0000 (22:33 +0100)
app/controllers/trace_controller.rb

index db86684a42a8da0cb93737b720e6bf3a762cc44e..9d0e0553060dfe29150223b4c48d78996a47b226 100644 (file)
@@ -122,8 +122,8 @@ class TraceController < ApplicationController
           logger.info("id is #{@trace.id}")
           flash[:notice] = t 'trace.create.trace_uploaded'
 
-          if @user.traces.count(:conditions => { :inserted => false }) > 4
-            flash[:warning] = t 'trace.trace_header.traces_waiting', :count => @user.traces.count(:conditions => { :inserted => false })
+          if @user.traces.where(:inserted => false).count > 4
+            flash[:warning] = t 'trace.trace_header.traces_waiting', :count => @user.traces.where(:inserted => false).count
           end
 
           redirect_to :action => :list, :display_name => @user.display_name