mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
improve secure_category_id query
This commit is contained in:
parent
df5f9d66e5
commit
162d94aa02
1 changed files with 2 additions and 2 deletions
|
@ -491,8 +491,8 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def secure_category_ids
|
||||
cats = self.staff? ? Category.select(:id).where(read_restricted: true) : secure_categories.select('categories.id').references(:categories)
|
||||
cats.map { |c| c.id }.sort
|
||||
cats = self.staff? ? Category.where(read_restricted: true) : secure_categories.references(:categories)
|
||||
cats.pluck('categories.id').sort
|
||||
end
|
||||
|
||||
def topic_create_allowed_category_ids
|
||||
|
|
Loading…
Reference in a new issue