[#4552] Add the Labor hours spent to the Deliverable details
This commit is contained in:
1 parent
7a5599b4f9
commit
38f2bcb17f
5 files changed
+116
-2
No files matched your search
@@ -86,6 +86,11 @@ class Deliverable < ActiveRecord::Base
|
||||
(overhead_budgets.sum(:hours) || 0.0)
|
||||
end
|
||||
|
||||
# OPTIMIZE: N+1
|
||||
def labor_hours_spent_total(date=nil)
|
||||
issues.inject(0) {|total, issue| total += issue.billable_time_spent } # From redmine_overhead
|
||||
end
|
||||
|
||||
# OPTIMIZE: N+1
|
||||
def hours_spent_total
|
||||
issues.inject(0) {|total, issue| total += issue.spent_hours }
|
||||
|
||||
Reference in new issue
Block a user