comparison app/controllers/enumerations_controller.rb @ 511:107d36338b70 live

Merge from branch "cannam"
author Chris Cannam
date Thu, 14 Jul 2011 10:43:07 +0100
parents cbce1fd3b1b7
children cbb26bc654de
comparison
equal deleted inserted replaced
451:a9f6345cb43d 511:107d36338b70
73 @enumeration = Enumeration.find(params[:id]) 73 @enumeration = Enumeration.find(params[:id])
74 if !@enumeration.in_use? 74 if !@enumeration.in_use?
75 # No associated objects 75 # No associated objects
76 @enumeration.destroy 76 @enumeration.destroy
77 redirect_to :action => 'index' 77 redirect_to :action => 'index'
78 return
78 elsif params[:reassign_to_id] 79 elsif params[:reassign_to_id]
79 if reassign_to = @enumeration.class.find_by_id(params[:reassign_to_id]) 80 if reassign_to = @enumeration.class.find_by_id(params[:reassign_to_id])
80 @enumeration.destroy(reassign_to) 81 @enumeration.destroy(reassign_to)
81 redirect_to :action => 'index' 82 redirect_to :action => 'index'
83 return
82 end 84 end
83 end 85 end
84 @enumerations = @enumeration.class.find(:all) - [@enumeration] 86 @enumerations = @enumeration.class.find(:all) - [@enumeration]
85 #rescue 87 #rescue
86 # flash[:error] = 'Unable to delete enumeration' 88 # flash[:error] = 'Unable to delete enumeration'