fix: some bug

This commit is contained in:
2021-06-02 15:29:00 +08:00
parent 2ad963cdf1
commit df6da37b95
4 changed files with 5 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ json.format_time target.created_at.strftime("%Y-%m-%d")
json.name user.try(:show_real_name)
json.login user.try(:login)
json.image_url url_to_avatar(user)
json.is_current_user current_user.try(:id) == target.user_id
json.is_current_user current_user.try(:id) == user.id
json.is_watch current_user&.watched?(user)

View File

@@ -1,7 +1,7 @@
json.count @watchers_count
json.users do
json.array! @watchers do |watcher|
json.partial! "/users/watch_user_detail", locals: {target: watcher, user: watcher.watchable}
json.partial! "/users/watch_user_detail", target: watcher, user: watcher.watchable
end
# json.partial! "/users/watch_user_detail", collection: @watchers, as: :target
end