[#5442] Add contract totals for labor and overhead hours spent and budgeted
This commit is contained in:
@@ -55,6 +55,19 @@ class Contract < ActiveRecord::Base
|
||||
end
|
||||
memoize :labor_spent
|
||||
|
||||
# OPTIMIZE: N+1
|
||||
def labor_hour_budget
|
||||
summarize_associated_values(deliverables, :labor_budget_hours)
|
||||
end
|
||||
memoize :labor_hour_budget
|
||||
|
||||
# OPTIMIZE: N+1
|
||||
# OPTIMIZE: also hits redmine_overhead which is known to be slow
|
||||
def labor_hour_spent
|
||||
summarize_associated_values(deliverables, :labor_hours_spent_total)
|
||||
end
|
||||
memoize :labor_hour_spent
|
||||
|
||||
# OPTIMIZE: N+1
|
||||
def overhead_budget
|
||||
summarize_associated_values(deliverables, :overhead_budget_total)
|
||||
@@ -68,6 +81,19 @@ class Contract < ActiveRecord::Base
|
||||
end
|
||||
memoize :overhead_spent
|
||||
|
||||
# OPTIMIZE: N+1
|
||||
def overhead_hour_budget
|
||||
summarize_associated_values(deliverables, :overhead_budget_hours)
|
||||
end
|
||||
memoize :overhead_hour_budget
|
||||
|
||||
# OPTIMIZE: N+1
|
||||
# OPTIMIZE: also hits redmine_overhead which is known to be slow
|
||||
def overhead_hour_spent
|
||||
summarize_associated_values(deliverables, :overhead_hours_spent_total)
|
||||
end
|
||||
memoize :overhead_hour_spent
|
||||
|
||||
# OPTIMIZE: N+1
|
||||
def estimated_hour_budget
|
||||
summarize_associated_values(deliverables, :estimated_hour_budget_total)
|
||||
|
||||
Reference in New Issue
Block a user