From 1b71063467724570a2888a8168680d70715ce96e Mon Sep 17 00:00:00 2001 From: Cedric VINCENT Date: Mon, 21 Sep 2009 14:52:19 +0200 Subject: [PATCH 2/3] Access params[:time_entry] only if editing a time entry. This fix avoids the following error that was triggered when editing the status (for instance): ActiveRecord::RecordNotFound (Couldn't find User with ID=0) --- app/controllers/issues_controller.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index af5e4c3..8959938 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -177,7 +177,7 @@ class IssuesController < ApplicationController end if request.post? - if User.current.allowed_to?(:edit_time_entries, @project) + if User.current.allowed_to?(:edit_time_entries, @project) and params[:time_entry] user = User.find(Hash[params[:time_entry].to_a]["user_id"].to_i) else # TODO: Maybe I should throw an exception if the current user -- 1.6.4