diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2009-03-21 00:39:53 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2009-03-21 00:39:53 +0000 |
commit | c2dfffd7f267b2064bb51d46aac6fb1429b37132 (patch) | |
tree | c6457a13a31ec69a4b8d8a3398a6b52523c68473 /app/models/issue.rb | |
parent | 451ef7f21f411d4bfe4138a71be269f566cd4647 (diff) | |
download | redmine-c2dfffd7f267b2064bb51d46aac6fb1429b37132.tar.gz redmine-c2dfffd7f267b2064bb51d46aac6fb1429b37132.zip |
Added some RDoc documentation for some models.
Submitted by austenito on Github.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2612 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 4e2a3c647..f3513e564 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -241,6 +241,11 @@ class Issue < ActiveRecord::Base recipients.compact.uniq end + # Returns the total number of hours spent on this issue. + # + # Example: + # spent_hours => 0 + # spent_hours => 50 def spent_hours @spent_hours ||= time_entries.sum(:hours) || 0 end @@ -269,6 +274,11 @@ class Issue < ActiveRecord::Base due_date || (fixed_version ? fixed_version.effective_date : nil) end + # Returns the time scheduled for this issue. + # + # Example: + # Start Date: 2/26/09, End Date: 3/04/09 + # duration => 6 def duration (start_date && due_date) ? due_date - start_date : 0 end |