Added some boolean tests to see if a Rate is a default rate. #1921

This commit is contained in:
Eric Davis
2009-01-20 15:37:53 -08:00
parent 8c5e58de04
commit 6141554976

View File

@@ -27,6 +27,14 @@ class Rate < ActiveRecord::Base
return !self.locked?
end
def default?
return self.project.nil?
end
def specific?
return !self.default?
end
# API to find the Rate for a +user+ on a +project+ at a +date+
def self.for(user, project = nil, date = Date.today.to_s)
# Check input since it's a "public" API