From 01b768392a1236cfe8652d3904764bc0fab20b0b Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 6 Nov 2013 16:56:49 -0500 Subject: [PATCH] Remove `default_scope` --- app/models/category.rb | 2 -- app/models/site.rb | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/category.rb b/app/models/category.rb index 4b90321914a..c44db4cb91d 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -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) { diff --git a/app/models/site.rb b/app/models/site.rb index 2ae43590c77..359977b0b6b 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -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))