From b09a483aa9852dbd3a3c581af78101a970c1b22c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 2 Mar 2010 20:03:09 +0000 Subject: [PATCH] Fixed: error while deleting an in-use enumeration (#4970). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3524 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/enumerations_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/enumerations_controller.rb b/app/controllers/enumerations_controller.rb index d39f5edf7..e5b50c873 100644 --- a/app/controllers/enumerations_controller.rb +++ b/app/controllers/enumerations_controller.rb @@ -76,12 +76,12 @@ class EnumerationsController < ApplicationController @enumeration.destroy redirect_to :action => 'index' elsif params[:reassign_to_id] - if reassign_to = Enumeration.find_by_type_and_id(@enumeration.type, params[:reassign_to_id]) + if reassign_to = @enumeration.class.find_by_id(params[:reassign_to_id]) @enumeration.destroy(reassign_to) redirect_to :action => 'index' end end - @enumerations = Enumeration.find(:all, :conditions => ['type = (?)', @enumeration.type]) - [@enumeration] + @enumerations = @enumeration.class.find(:all) - [@enumeration] #rescue # flash[:error] = 'Unable to delete enumeration' # redirect_to :action => 'index'