diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-04-05 16:11:56 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-04-05 16:11:56 +0000 |
commit | 92292a56e9d53f907cd2ee7e51b4ad70d5ca89ce (patch) | |
tree | 8c84a8ba21a17d088ed133149c570b495f7fe701 /app/models | |
parent | f637a4e4ced20c3ee22fa9d9ec71a54205025c76 (diff) | |
download | redmine-92292a56e9d53f907cd2ee7e51b4ad70d5ca89ce.tar.gz redmine-92292a56e9d53f907cd2ee7e51b4ad70d5ca89ce.zip |
Merged r16491 (#25526).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16493 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/issue.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index f569ed0b2..40e30e003 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1003,7 +1003,7 @@ class Issue < ActiveRecord::Base # Returns the number of hours spent on this issue def spent_hours - @spent_hours ||= time_entries.sum(:hours) || 0 + @spent_hours ||= time_entries.sum(:hours) || 0.0 end # Returns the total number of hours spent on this issue and its descendants @@ -1042,7 +1042,7 @@ class Issue < ActiveRecord::Base if issues.any? hours_by_issue_id = TimeEntry.visible(user).where(:issue_id => issues.map(&:id)).group(:issue_id).sum(:hours) issues.each do |issue| - issue.instance_variable_set "@spent_hours", (hours_by_issue_id[issue.id] || 0) + issue.instance_variable_set "@spent_hours", (hours_by_issue_id[issue.id] || 0.0) end end end @@ -1055,7 +1055,7 @@ class Issue < ActiveRecord::Base " AND parent.lft <= #{Issue.table_name}.lft AND parent.rgt >= #{Issue.table_name}.rgt"). where("parent.id IN (?)", issues.map(&:id)).group("parent.id").sum(:hours) issues.each do |issue| - issue.instance_variable_set "@total_spent_hours", (hours_by_issue_id[issue.id] || 0) + issue.instance_variable_set "@total_spent_hours", (hours_by_issue_id[issue.id] || 0.0) end end end |