Swapped inject with a simple sum method. #1924

This commit is contained in:
Eric Davis committed 2009-01-21 15:26:46 -08:00
1 parent 3d8c1ecc5c
commit 075310da6b
4 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -111,7 +111,7 @@ class Budget
def amount_missing_on_issues
time_logs = TimeEntry.find_all_by_project_id_and_issue_id(self.project, nil)
return time_logs.collect(&:cost).inject { |sum, n| sum + n}
return time_logs.collect(&:cost).sum
end
# Dollar amount of time that has been logged to issues that are not assigned to deliverables
@@ -127,6 +127,6 @@ class Budget
time_logs = missing_issues.collect(&:time_entries).flatten
return time_logs.collect(&:cost).inject { |sum, n| sum + n}
return time_logs.collect(&:cost).sum
end
end