better add some tests here tomorrow
This commit is contained in:
parent
b6bf95e741
commit
670b66ade3
|
@ -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 }
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue