Added some comments to make the source easier to scan
This commit is contained in:
+23
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user