Removed all the duplicate methods that were getting the rate for each TimeEntry
and replaced them with a simple collector that uses the new TimeEntry#cost method (that wraps the Rate API). #1924
This commit is contained in:
1 parent
7fa4f33748
commit
3d8c1ecc5c
6 files changed
+9
-42
No files matched your search
@@ -10,13 +10,7 @@ class HourlyDeliverable < Deliverable
|
||||
# Get all timelogs assigned
|
||||
time_logs = self.issues.collect(&:time_entries).flatten
|
||||
|
||||
# Find each Member for their rate
|
||||
time_logs.each do |time_log|
|
||||
rate = Rate.amount_for(time_log.user, time_log.project, time_log.spent_on.to_s)
|
||||
total += (rate * time_log.hours) unless rate.nil?
|
||||
end
|
||||
|
||||
return total
|
||||
return time_logs.collect(&:cost).inject { |sum, n| sum + n}
|
||||
end
|
||||
|
||||
def profit # :nodoc:
|
||||
|
||||
Reference in new issue
Block a user