From 5d5f72b927ed38eab852b63d84cfb6538837e8fb Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 18 Jul 2008 22:23:26 +0000 Subject: [PATCH] More warning fixes. --- app/controllers/trace_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 0467e66ba..41ff34303 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -18,7 +18,7 @@ class TraceController < ApplicationController # set title if target_user.nil? @title = "Public GPS traces" - elsif @user and @user.id == target_user.id + elsif @user and @user == target_user @title = "Your GPS traces" else @title = "Public GPS traces from #{target_user.display_name}" @@ -38,7 +38,7 @@ class TraceController < ApplicationController conditions = ["gpx_files.public = 1"] #2 end else - if @user and @user.id == target_user.id + if @user and @user == target_user conditions = ["gpx_files.user_id = ?", @user.id] #3 (check vs user id, so no join + can't pick up non-public traces by changing name) else conditions = ["gpx_files.public = 1 AND gpx_files.user_id = ?", target_user.id] #4 @@ -88,7 +88,7 @@ class TraceController < ApplicationController @trace = Trace.find(params[:id]) if @trace and @trace.visible? and - (@trace.public? or @trace.user.id == @user.id) + (@trace.public? or @trace.user == @user) @title = "Viewing trace #{@trace.name}" else flash[:notice] = "Trace not found!" -- 2.45.1