fix case when there are no tags places on todos, the stats page would fail. Fixes #822.

Thanks Walter for finding this one
This commit is contained in:
Reinier Balt 2009-01-15 22:13:22 +01:00
parent 278c7310c1
commit 8cdae83014
2 changed files with 18 additions and 1 deletions

View file

@ -652,6 +652,7 @@ class StatsController < ApplicationController
"AND tags.id = taggings.tag_id " +
"AND taggings.taggable_id = todos.id ", current_user.id])
tags_ids_s = tag_ids.map(&:id).sort.join(",")
return {} if tags_ids_s.blank? # return empty array for .size to work
return Tag.find(:all, :conditions => "id in (" + tags_ids_s + ")")
end