From f514b15361002e55a567bf3cc9c49f69b846a5f4 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 17 Feb 2011 11:47:59 -0800 Subject: [PATCH] Added some comments to make the source easier to scan --- app/models/contract.rb | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/app/models/contract.rb b/app/models/contract.rb index be82254..80d8d61 100644 --- a/app/models/contract.rb +++ b/app/models/contract.rb @@ -42,6 +42,10 @@ class Contract < ActiveRecord::Base define_method(mthd) { "TODO in later release" } end + # ------------------------------------------------------------ + # Labor Methods + # ------------------------------------------------------------ + # Currency value that is budgeted for the contract for labor # ie. estimated billable amount # @@ -80,6 +84,10 @@ class Contract < ActiveRecord::Base end memoize :labor_hour_spent + # ------------------------------------------------------------ + # Overhead Methods + # ------------------------------------------------------------ + # Currency value budgeted for the contract on overhead # ie. estimated non-billable amount # @@ -118,6 +126,10 @@ class Contract < ActiveRecord::Base end memoize :overhead_hour_spent + # ------------------------------------------------------------ + # Total Methods (labor + overhead) + # ------------------------------------------------------------ + # Total hours budgeted for the contract # ie. total time estimated # @@ -154,6 +166,10 @@ class Contract < ActiveRecord::Base end memoize :total_spent + # ------------------------------------------------------------ + # Profit Methods + # ------------------------------------------------------------ + # Estimated currency amount of profit # ie. profit estimate # @@ -172,6 +188,10 @@ class Contract < ActiveRecord::Base alias_method :profit_spent, :profit_left memoize :profit_left + # ------------------------------------------------------------ + # Fixed Budget Methods + # ------------------------------------------------------------ + # Currency amount of estimated fixed expenses # # OPTIMIZE: N+1 @@ -204,7 +224,9 @@ class Contract < ActiveRecord::Base summarize_associated_values(deliverables, :fixed_markup_budget_total_spent) end memoize :fixed_markup_spent - + + # ------------------------------------------------------------ + def after_initialize self.executed = false unless self.executed.present? end