diff options
author | George Andrinopoulos <geoandri@gmail.com> | 2017-11-06 20:18:20 +0200 |
---|---|---|
committer | George Andrinopoulos <geoandri@gmail.com> | 2017-11-11 16:47:39 +0200 |
commit | 561693ad173b22dab54a0fdd5446f7637095272a (patch) | |
tree | 76b6d9c46f5dd4c5df50f4e251beafc1a23349e4 /app/models/concerns | |
parent | 2f9c23eb7e594c40bee0e66b111132d1481af1a3 (diff) | |
download | gitlab-ce-561693ad173b22dab54a0fdd5446f7637095272a.tar.gz |
Move total time spend calculation to milestoneish
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/milestoneish.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/concerns/milestoneish.rb b/app/models/concerns/milestoneish.rb index 710fc1ed647..7fe55f8402f 100644 --- a/app/models/concerns/milestoneish.rb +++ b/app/models/concerns/milestoneish.rb @@ -86,6 +86,14 @@ module Milestoneish false end + def total_issue_time_spent + issues.joins(:timelogs).sum(:time_spent) + end + + def human_total_issue_time_spent + Gitlab::TimeTrackingFormatter.output(total_issue_time_spent) + end + private def count_issues_by_state(user) |