Ported FixedDeliverable.spent to use Rate. #1924

This commit is contained in:
Eric Davis
2009-01-21 14:31:06 -08:00
parent 50a466d7af
commit 4f18c28bba
2 changed files with 4 additions and 5 deletions

View File

@@ -19,8 +19,8 @@ class FixedDeliverable < Deliverable
# Find each Member for their rate
time_logs.each do |time_log|
member = Member.find_by_user_id_and_project_id(time_log.user_id, time_log.project_id)
total += (member.rate * time_log.hours) unless member.nil? || member.rate.nil?
rate = Rate.amount_for(time_log.user, time_log.project, time_log.spent_on)
total += (rate * time_log.hours) unless rate.nil?
end
return total