Added ability to change a deliverables type

This commit is contained in:
Eric Davis
2008-06-04 16:50:19 -07:00
parent 86741878c6
commit ba8a3400ec
2 changed files with 14 additions and 1 deletions
+4 -1
View File
@@ -63,9 +63,12 @@ class DeliverablesController < ApplicationController
end
def update
# TODO: Handle type change
@deliverable = Deliverable.find(params[:deliverable_id])
if params[:deliverable][:type] != @deliverable.class
@deliverable = @deliverable.change_type(params[:deliverable][:type])
end
respond_to do |format|
if @deliverable.update_attributes(params[:deliverable])
@flash = l(:notice_successful_create)