Added support for STI deliverables

* HourlyDeliverables cost are based on the time used
* FixedDeliverables are based on a flat rate
* Added a checkbox on the new Deliverable form to pick which one to use

  #1135
This commit is contained in:
Eric Davis
2008-05-21 09:15:52 -07:00
parent bd5bb6d1c5
commit 8548d46637
4 changed files with 18 additions and 4 deletions
+8 -2
View File
@@ -31,9 +31,15 @@ class DeliverablesController < ApplicationController
end
def create
@deliverable = Deliverable.new(params[:deliverable])
if params[:deliverable][:type] == FixedDeliverable.name
@deliverable = FixedDeliverable.new(params[:deliverable])
elsif params[:deliverable][:type] == HourlyDeliverable.name
@deliverable = HourlyDeliverable.new(params[:deliverable])
else
@deliverable = Deliverable.new(params[:deliverable])
end
@deliverable.project = @project
respond_to do |format|
if @deliverable.save
@flash = l(:notice_successful_create)