[#4182] Added an OverheadBudget to track a Deliverable's overhead.
This commit is contained in:
@@ -5,8 +5,10 @@ class Deliverable < ActiveRecord::Base
|
||||
belongs_to :contract
|
||||
belongs_to :manager, :class_name => 'User', :foreign_key => 'manager_id'
|
||||
has_many :labor_budgets
|
||||
has_many :overhead_budgets
|
||||
|
||||
accepts_nested_attributes_for :labor_budgets
|
||||
accepts_nested_attributes_for :overhead_budgets
|
||||
|
||||
# Validations
|
||||
validates_presence_of :title
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
class OverheadBudget < ActiveRecord::Base
|
||||
unloadable
|
||||
|
||||
# Associations
|
||||
belongs_to :deliverable
|
||||
|
||||
# Validations
|
||||
|
||||
# Accessors
|
||||
|
||||
def budget=(v)
|
||||
if v.is_a? String
|
||||
write_attribute(:budget, v.gsub(/[$ ,]/, ''))
|
||||
else
|
||||
write_attribute(:budget, v)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user