mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -06:00
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]
|
skip_before_filter :check_xhr, only: [:index]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@list = CategoryList.new(current_user)
|
@list = CategoryList.new(guardian)
|
||||||
discourse_expires_in 1.minute
|
discourse_expires_in 1.minute
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { render }
|
format.html { render }
|
||||||
|
@ -4,6 +4,8 @@ class CategoryList
|
|||||||
attr_accessor :categories, :topic_users, :uncategorized
|
attr_accessor :categories, :topic_users, :uncategorized
|
||||||
|
|
||||||
def initialize(guardian)
|
def initialize(guardian)
|
||||||
|
guardian ||= Guardian.new
|
||||||
|
|
||||||
@categories = Category
|
@categories = Category
|
||||||
.includes(featured_topics: [:category])
|
.includes(featured_topics: [:category])
|
||||||
.includes(:featured_users)
|
.includes(:featured_users)
|
||||||
|
Loading…
Reference in New Issue
Block a user