Implementing Budget class along with it's helper methods. #1137
This commit is contained in:
1 parent
5093377a5b
commit
8c02ee4ade
2 files changed
+142
No files matched your search
@@ -4,5 +4,47 @@
|
||||
# belongs_to :project
|
||||
#
|
||||
class Budget
|
||||
|
||||
attr_reader :project
|
||||
|
||||
def initialize(project_id)
|
||||
@project = Project.find(project_id)
|
||||
end
|
||||
|
||||
def next_due_date
|
||||
del = self.deliverables
|
||||
return nil unless del.size > 0
|
||||
|
||||
dates = del.collect(&:due_date).delete_if { |d| d.blank?}
|
||||
|
||||
return dates.sort[0]
|
||||
end
|
||||
|
||||
def deliverables
|
||||
return self.project.deliverables
|
||||
end
|
||||
|
||||
# TODO
|
||||
def spent
|
||||
end
|
||||
|
||||
# TODO
|
||||
def left
|
||||
end
|
||||
|
||||
# TODO
|
||||
def progress
|
||||
end
|
||||
|
||||
# TODO
|
||||
def score
|
||||
end
|
||||
|
||||
# TODO
|
||||
def final_due_date
|
||||
end
|
||||
|
||||
# TODO
|
||||
def profit
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user