Remove `default_scope`
This commit is contained in:
parent
006e72ff5a
commit
01b768392a
|
@ -45,8 +45,6 @@ class Category < ActiveRecord::Base
|
|||
has_one :category_search_data
|
||||
belongs_to :parent_category, class_name: 'Category'
|
||||
|
||||
default_scope order('position')
|
||||
|
||||
scope :latest, ->{ order('topic_count desc') }
|
||||
|
||||
scope :secured, ->(guardian = nil) {
|
||||
|
|
|
@ -33,8 +33,9 @@ class Site
|
|||
@categories ||= begin
|
||||
categories = Category
|
||||
.secured(@guardian)
|
||||
.latest
|
||||
.includes(:topic_only_relative_url).to_a
|
||||
.includes(:topic_only_relative_url)
|
||||
.order(:position)
|
||||
.to_a
|
||||
|
||||
allowed_topic_create = Set.new(Category.topic_create_allowed(@guardian).pluck(:id))
|
||||
|
||||
|
|
Loading…
Reference in New Issue