From 63100ae8a0f0ac810355ffb9578c8b5d1641a8d0 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 29 Sep 2013 22:33:04 +0100 Subject: [PATCH] Convert trace counting to use modern arel methods --- app/controllers/trace_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index db86684a4..9d0e05530 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -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 -- 2.39.5