summaryrefslogtreecommitdiffstats
path: root/app/controllers/enumerations_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-05-17 18:18:06 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-05-17 18:18:06 +0000
commitc90bf645f51383ffb7bf2e3427b3e4c4672580f3 (patch)
treebd00abdec57cf27c334eea3e61539cbd11680441 /app/controllers/enumerations_controller.rb
parentd6789593597694e78c4b2c5f40fe63cef3c48002 (diff)
downloadredmine-c90bf645f51383ffb7bf2e3427b3e4c4672580f3.tar.gz
redmine-c90bf645f51383ffb7bf2e3427b3e4c4672580f3.zip
Fixed that submitting the form without selecting a value may raise raises an error with SQLServer (#13783).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11854 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/enumerations_controller.rb')
-rw-r--r--app/controllers/enumerations_controller.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/controllers/enumerations_controller.rb b/app/controllers/enumerations_controller.rb
index 125e87cff..2ca68f4f6 100644
--- a/app/controllers/enumerations_controller.rb
+++ b/app/controllers/enumerations_controller.rb
@@ -70,12 +70,10 @@ class EnumerationsController < ApplicationController
@enumeration.destroy
redirect_to enumerations_path
return
- elsif params[:reassign_to_id]
- if reassign_to = @enumeration.class.find_by_id(params[:reassign_to_id])
- @enumeration.destroy(reassign_to)
- redirect_to enumerations_path
- return
- end
+ elsif params[:reassign_to_id].present? && (reassign_to = @enumeration.class.find_by_id(params[:reassign_to_id].to_i))
+ @enumeration.destroy(reassign_to)
+ redirect_to enumerations_path
+ return
end
@enumerations = @enumeration.class.system.all - [@enumeration]
end