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
This commit is contained in:
Jean-Philippe Lang
2013-05-17 18:18:06 +00:00
parent d678959359
commit c90bf645f5
3 changed files with 12 additions and 7 deletions
+4 -6
View File
@@ -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