forked from Gitlink/forgeplus
Change Bug
This commit is contained in:
parent
1f42076d20
commit
d5e57da6d4
|
@ -132,7 +132,7 @@ module ApiIndexHelper
|
|||
def set_children_sections(objects,is_detail)
|
||||
children_sections_array = []
|
||||
objects.find_each do |sec|
|
||||
image = sec.attachments&.last
|
||||
image = sec.image_attachment
|
||||
s_section = {
|
||||
id: sec.id,
|
||||
title: sec.title
|
||||
|
|
|
@ -13,7 +13,8 @@ module Watchable
|
|||
end
|
||||
|
||||
def watched_by?(user)
|
||||
!!(user && self.watcher_user_ids && self.watcher_user_ids.detect {|uid| uid == user.id })
|
||||
watcher_users.exists?(id: user.id)
|
||||
# !!(user && self.watcher_user_ids && self.watcher_user_ids.detect {|uid| uid == user.id })
|
||||
end
|
||||
|
||||
def watch!(watchable)
|
||||
|
|
|
@ -477,9 +477,9 @@ class MemosService
|
|||
set_msg = "您没有权限"
|
||||
end
|
||||
|
||||
memos = Memo.field_for_list.includes(:praise_tread, :author).where(:root_id => nil).order("sticky=1 desc, #{s_order} desc").limit(15)
|
||||
memo_list = memo_data memos
|
||||
{status: set_status, message: set_msg, memo_list: memo_list}
|
||||
# memos = Memo.field_for_list.includes(:praise_tread, :author, :forums).where(:root_id => nil).order("sticky=1 desc, #{s_order} desc").limit(15)
|
||||
# memo_list = memo_data memos
|
||||
{status: set_status, message: set_msg}
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddWatchersCountToMemos < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :memos, :watchers_count, :integer, default: 0
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue