Added ability to change a deliverables type
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user