[#4466] Added deprecated methods to support more of the Budget plugin API.

This commit is contained in:
Eric Davis
2010-09-01 14:32:09 -07:00
parent f899b4e623
commit 0c38fe2c37
+31 -5
View File
@@ -63,11 +63,6 @@ class Deliverable < ActiveRecord::Base
issues.inject(0) {|total, issue| total += issue.spent_hours }
end
# Wrapper for the old Budget plugins' API
def due
end_date
end
def retainer?
type == "RetainerDeliverable"
end
@@ -83,6 +78,37 @@ class Deliverable < ActiveRecord::Base
end
end
# Accessors from the budget plugin that need to be wrapped
def subject
warn "[DEPRECATION] Deliverable#subject is deprecated. Please use Deliverable#title instead."
title
end
def due
warn "[DEPRECATION] Deliverable#due is deprecated. Please use Deliverable#end_date instead."
end_date
end
def hours_used
warn "[DEPRECATION] Deliverable#hours_used is deprecated. Please use Deliverable#hours_spent_total instead."
hours_spent_total
end
def spent
warn "[DEPRECATION] Deliverable#spent is deprecated. Please use Deliverable#total_spent instead."
total_spent
end
def total_hours
warn "[DEPRECATION] Deliverable#total_hours is deprecated. Please use Deliverable#estimated_hour_budget_total instead."
estimated_hour_budget_total
end
def labor_budget
warn "[DEPRECATION] Deliverable#labor_budget is deprecated. Please use Deliverable#labor_budget_total instead."
labor_budget_total
end
if Rails.env.test?
generator_for :title, :method => :next_title