[#6441] Block logging time on closed contracts or deliverables

This commit is contained in:
Eric Davis
2011-08-08 13:46:28 -07:00
parent 5e2e309304
commit 953587ce46
6 changed files with 186 additions and 0 deletions
+16
View File
@@ -48,6 +48,22 @@ class Contract < ActiveRecord::Base
read_attribute(:status) || "open"
end
def lock!
update_attribute(:status, "locked")
end
def close!
update_attribute(:status, "closed")
end
def locked?
self.status == "locked"
end
def closed?
self.status == "closed"
end
# ------------------------------------------------------------
# Labor Methods
# ------------------------------------------------------------
+16
View File
@@ -55,6 +55,22 @@ class Deliverable < ActiveRecord::Base
nil
end
def lock!
update_attribute(:status, "locked")
end
def close!
update_attribute(:status, "closed")
end
def locked?
self.status == "locked"
end
def closed?
self.status == "closed"
end
def to_s
title
end