improve last path. Thanks Vitaliel!

This commit is contained in:
Reinier Balt 2009-01-17 14:43:06 +01:00
parent 8cdae83014
commit 01a011ee06
2 changed files with 2 additions and 5 deletions

View file

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

View file

@ -99,10 +99,7 @@ class StatsControllerTest < Test::Unit::TestCase
assert_response :success assert_response :success
# clear taggings table and render again # clear taggings table and render again
taggings = Tagging.find(:all) Tagging.delete_all
taggings.each do |t|
t.delete
end
get :index get :index
assert_response :success assert_response :success