From 52ee1928cc99bd9073b131b8fb75b50b41626a1b Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 7 May 2013 15:40:18 -0400 Subject: [PATCH] Oops, I made a spec fail by refactoring after I made the test pass and didn't check the tests --- app/models/category_list.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/category_list.rb b/app/models/category_list.rb index 4d4d4c2546e..9afb9e3301f 100644 --- a/app/models/category_list.rb +++ b/app/models/category_list.rb @@ -53,7 +53,11 @@ class CategoryList @categories.delete_if { |c| c.featured_topics.blank? } else # Show all categories to people who have the ability to edit and delete categories - @categories.insert(@categories.size, *Category.where('id not in (?)', @categories.map(&:id).compact).to_a) + if @categories.size > 0 + @categories.insert(@categories.size, *Category.where('id not in (?)', @categories.map(&:id).compact).to_a) + else + @categories = Category.all.to_a + end end # Get forum topic user records if appropriate