Refactored the class and added more tests on calculations. #1924
This commit is contained in:
@@ -137,6 +137,7 @@ class Deliverable < ActiveRecord::Base
|
||||
def budget_remaining
|
||||
return self.budget - self.spent
|
||||
end
|
||||
alias :left :budget_remaining
|
||||
|
||||
# Number of hours used.
|
||||
def hours_used
|
||||
@@ -154,11 +155,6 @@ class Deliverable < ActiveRecord::Base
|
||||
return self.members_spent.collect(&:spent).sum
|
||||
end
|
||||
|
||||
# Amount of the budget remaining
|
||||
def left
|
||||
return self.budget - self.spent
|
||||
end
|
||||
|
||||
# Amount spent over the total budget
|
||||
def overruns
|
||||
if self.left >= 0
|
||||
|
||||
Reference in New Issue
Block a user