BUGFIX: missing avatars in topic map

Cleanup uneeded column
This commit is contained in:
Sam 2014-05-29 14:59:14 +10:00
parent a47581de18
commit 5adc486cef
6 changed files with 15 additions and 5 deletions

View File

@ -297,7 +297,7 @@ class UsersController < ApplicationController
results = UserSearch.new(term, topic_id: topic_id, searching_user: current_user).search
user_fields = [:username, :use_uploaded_avatar, :upload_avatar_template, :uploaded_avatar_id]
user_fields = [:username, :upload_avatar_template, :uploaded_avatar_id]
user_fields << :name if SiteSetting.enable_names?
to_render = { users: results.as_json(only: user_fields, methods: :avatar_template) }

View File

@ -585,6 +585,7 @@ end
# version :integer default(1), not null
# cook_method :integer default(1), not null
# wiki :boolean default(FALSE), not null
# baked_at :datetime
#
# Indexes
#

View File

@ -799,7 +799,6 @@ end
# blocked :boolean default(FALSE)
# dynamic_favicon :boolean default(FALSE), not null
# title :string(255)
# use_uploaded_avatar :boolean default(FALSE)
# uploaded_avatar_id :integer
# email_always :boolean default(FALSE), not null
# mailing_list_mode :boolean default(FALSE), not null

View File

@ -1,2 +1,10 @@
class UserProfile < ActiveRecord::Base
end
# == Schema Information
#
# Table name: user_profiles
#
# user_id :integer not null, primary key
# location :string(255)
#

View File

@ -18,7 +18,4 @@ class TopicPostCountSerializer < BasicUserSerializer
object[:user].uploaded_avatar_id
end
def include_uploaded_avatar_id?
SiteSetting.allow_uploaded_avatars? && object[:user].use_uploaded_avatar
end
end

View File

@ -0,0 +1,5 @@
class RemoveUseUploadedAvatarFromUser < ActiveRecord::Migration
def change
remove_column :users, :use_uploaded_avatar
end
end