better add some tests here tomorrow

This commit is contained in:
Sam 2013-05-13 18:47:32 +10:00
parent b6bf95e741
commit 670b66ade3
2 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,7 @@ class CategoriesController < ApplicationController
skip_before_filter :check_xhr, only: [:index]
def index
@list = CategoryList.new(current_user)
@list = CategoryList.new(guardian)
discourse_expires_in 1.minute
respond_to do |format|
format.html { render }

View File

@ -4,6 +4,8 @@ class CategoryList
attr_accessor :categories, :topic_users, :uncategorized
def initialize(guardian)
guardian ||= Guardian.new
@categories = Category
.includes(featured_topics: [:category])
.includes(:featured_users)