summaryrefslogtreecommitdiffstats
path: root/app/controllers/workflows_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-19 12:40:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-19 12:40:43 +0000
commit008ad85d10c299f4bcca25a20753740836325786 (patch)
treedfc6ff7441db8ec286242bd3ccc088a38ecd7091 /app/controllers/workflows_controller.rb
parent03b57415d66e9f8522099ae454b49edd9342839d (diff)
downloadredmine-008ad85d10c299f4bcca25a20753740836325786.tar.gz
redmine-008ad85d10c299f4bcca25a20753740836325786.zip
Fixes an error with postgres.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3193 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/workflows_controller.rb')
-rw-r--r--app/controllers/workflows_controller.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rb
index fd2876769..35ec8ab71 100644
--- a/app/controllers/workflows_controller.rb
+++ b/app/controllers/workflows_controller.rb
@@ -54,8 +54,16 @@ class WorkflowsController < ApplicationController
@trackers = Tracker.find(:all, :order => 'position')
@roles = Role.find(:all, :order => 'builtin, position')
- @source_tracker = params[:source_tracker_id].blank? ? nil : Tracker.find_by_id(params[:source_tracker_id])
- @source_role = params[:source_role_id].blank? ? nil : Role.find_by_id(params[:source_role_id])
+ if params[:source_tracker_id].blank? || params[:source_tracker_id] == 'any'
+ @source_tracker = nil
+ else
+ @source_tracker = Tracker.find_by_id(params[:source_tracker_id].to_i)
+ end
+ if params[:source_role_id].blank? || params[:source_role_id] == 'any'
+ @source_role = nil
+ else
+ @source_role = Role.find_by_id(params[:source_role_id].to_i)
+ end
@target_trackers = params[:target_tracker_ids].blank? ? nil : Tracker.find_all_by_id(params[:target_tracker_ids])
@target_roles = params[:target_role_ids].blank? ? nil : Role.find_all_by_id(params[:target_role_ids])