accelerate user name query

This commit is contained in:
邱博亞 2021-11-08 20:46:09 +08:00
parent 6cab85f96a
commit 563dc35b8e
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ class AnnouncementsController < ApplicationController
locale = OrbitHelper.get_site_locale.to_s locale = OrbitHelper.get_site_locale.to_s
files = a.bulletin_files.to_fronted(locale) files = a.bulletin_files.to_fronted(locale)
links = a.bulletin_links.map{|link| { "link_url" => link.url, "link_title" => (link.title.blank? ? link.url : link.title) } } rescue [] links = a.bulletin_links.map{|link| { "link_url" => link.url, "link_title" => (link.title.blank? ? link.url : link.title) } } rescue []
author = User.find(a.create_user_id).member_profile.name rescue "" author = User.find(a.create_user_id).member_name rescue (User.find(a.create_user_id).member_profile.name rescue "")
desc = a.image_description desc = a.image_description
desc = (desc.blank? ? "announcement image" : desc) desc = (desc.blank? ? "announcement image" : desc)
link_to_show = a.is_external_link ? a.external_link : OrbitHelper.url_to_show(a.to_param) link_to_show = a.is_external_link ? a.external_link : OrbitHelper.url_to_show(a.to_param)