mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: Use has_many and ArraySerializer for SidebarSectionsSerializer (#26716)
This commit is contained in:

committed by
GitHub

parent
10f77556cd
commit
a6b8051645
@ -367,6 +367,13 @@ class User < ActiveRecord::Base
|
||||
custom_fields_clean? || SiteSetting.disable_watched_word_checking_in_user_fields
|
||||
end
|
||||
|
||||
def all_sidebar_sections
|
||||
sidebar_sections
|
||||
.or(SidebarSection.public_sections)
|
||||
.includes(:sidebar_urls)
|
||||
.order("(section_type IS NOT NULL) DESC, (public IS TRUE) DESC")
|
||||
end
|
||||
|
||||
def secured_sidebar_category_ids(user_guardian = nil)
|
||||
user_guardian ||= guardian
|
||||
|
||||
|
Reference in New Issue
Block a user