Refactor: move method to Model.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4086 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis committed 2010-09-14 19:02:20 +00:00
1 parent 1b90703157
commit 8900797ada
3 files changed
+25 -2

No files matched your search

+8
View File
@@ -81,4 +81,12 @@ class TimeEntry < ActiveRecord::Base
yield
end
end
def self.earilest_date_for_project
TimeEntry.minimum(:spent_on, :include => :project, :conditions => Project.allowed_to_condition(User.current, :view_time_entries))
end
def self.latest_date_for_project
TimeEntry.maximum(:spent_on, :include => :project, :conditions => Project.allowed_to_condition(User.current, :view_time_entries))
end
end