@@ -947,7 +947,7 class Issue < ActiveRecord::Base | |||
|
947 | 947 | end |
|
948 | 948 | end |
|
949 | 949 | |
|
950 |
# Preloads visible |
|
|
950 | # Preloads visible spent time for a collection of issues | |
|
951 | 951 | def self.load_visible_spent_hours(issues, user=User.current) |
|
952 | 952 | if issues.any? |
|
953 | 953 | hours_by_issue_id = TimeEntry.visible(user).where(:issue_id => issues.map(&:id)).group(:issue_id).sum(:hours) |
@@ -957,6 +957,7 class Issue < ActiveRecord::Base | |||
|
957 | 957 | end |
|
958 | 958 | end |
|
959 | 959 | |
|
960 | # Preloads visible total spent time for a collection of issues | |
|
960 | 961 | def self.load_visible_total_spent_hours(issues, user=User.current) |
|
961 | 962 | if issues.any? |
|
962 | 963 | hours_by_issue_id = TimeEntry.visible(user).joins(:issue). |
General Comments 0
You need to be logged in to leave comments.
Login now