summaryrefslogtreecommitdiffstats
path: root/app/models/time_entry.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-09-14 19:02:20 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-09-14 19:02:20 +0000
commit8900797adaf29adc447925b800d5457ca941795f (patch)
tree44b77bb09d58df8879251c3a2f96de6f27597264 /app/models/time_entry.rb
parent1b90703157a182d37496ae4c8e3c430681abddc0 (diff)
downloadredmine-8900797adaf29adc447925b800d5457ca941795f.tar.gz
redmine-8900797adaf29adc447925b800d5457ca941795f.zip
Refactor: move method to Model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4086 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/time_entry.rb')
-rw-r--r--app/models/time_entry.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb
index 73f39f949..56801a4ca 100644
--- a/app/models/time_entry.rb
+++ b/app/models/time_entry.rb
@@ -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