DEV: remove uploaded_meta_id column from category (#6725)

* DEV: remove uploaded_meta_id column from category

* remove uploaded_meta part
This commit is contained in:
Saurabh Patel
2019-01-10 07:07:21 +05:30
committed by Guo Xiang Tan
parent a52baf4b28
commit b63b399799
8 changed files with 12 additions and 10 deletions

View File

@@ -28,7 +28,6 @@ class Category < ActiveRecord::Base
belongs_to :latest_post, class_name: "Post"
belongs_to :uploaded_logo, class_name: "Upload"
belongs_to :uploaded_background, class_name: "Upload"
belongs_to :uploaded_meta, class_name: "Upload"
has_many :topics
has_many :category_users
@@ -666,7 +665,6 @@ end
# sort_ascending :boolean
# uploaded_logo_id :integer
# uploaded_background_id :integer
# uploaded_meta_id :integer
# topic_featured_link_allowed :boolean default(TRUE)
# all_topics_wiki :boolean default(FALSE), not null
# show_subcategory_list :boolean default(FALSE)

View File

@@ -69,7 +69,6 @@ class CategoryList
@categories = Category.includes(
:uploaded_background,
:uploaded_logo,
:uploaded_meta,
:topic_only_relative_url,
subcategories: [:topic_only_relative_url]
).secured(@guardian)

View File

@@ -28,7 +28,7 @@ class Site
def categories
@categories ||= begin
categories = Category
.includes(:uploaded_logo, :uploaded_background, :uploaded_meta)
.includes(:uploaded_logo, :uploaded_background)
.secured(@guardian)
.joins('LEFT JOIN topics t on t.id = categories.topic_id')
.select('categories.*, t.slug topic_slug')