mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
修改watcher
This commit is contained in:
@@ -71,7 +71,7 @@ class User < ApplicationRecord
|
||||
has_many :be_watchers, foreign_key: :user_id, dependent: :destroy # 我的关注
|
||||
has_many :be_watcher_users, through: :be_watchers, dependent: :destroy # 我关注的用户
|
||||
|
||||
has_many :watchers, dependent: :destroy
|
||||
has_many :watchers, as: :watchable, dependent: :destroy
|
||||
|
||||
# 认证
|
||||
has_many :apply_user_authentication
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
user = target.watchable
|
||||
# user = target.watchable
|
||||
|
||||
json.format_time target.created_at.strftime("%Y-%m-%d")
|
||||
json.name user.try(:show_real_name)
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
json.count @watchers_count
|
||||
json.users do
|
||||
json.partial! "/users/watch_user_detail", collection: @watchers, as: :target
|
||||
json.array! @watchers do |watcher|
|
||||
json.partial! "/users/watch_user_detail", locals: {target: watcher, user: target.user}
|
||||
end
|
||||
# json.partial! "/users/watch_user_detail", collection: @watchers, as: :target
|
||||
end
|
||||
@@ -1,4 +1,7 @@
|
||||
json.count @watchers_count
|
||||
json.users do
|
||||
json.partial! "/users/watch_user_detail", collection: @watchers, as: :target
|
||||
json.array! @watchers do |watcher|
|
||||
json.partial! "/users/watch_user_detail", locals: {target: watcher, user: watcher.watchable}
|
||||
end
|
||||
# json.partial! "/users/watch_user_detail", collection: @watchers, as: :target
|
||||
end
|
||||
Reference in New Issue
Block a user