fix: some bug

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

View File

@ -12,6 +12,6 @@ if trend.trend_type == "Issue"
elsif trend.trend_type == "VersionRelease"
json.partial! "version_releases/simple_version_release", locals: {version: trend.trend}
else
json.name trend.trend.title
json.created_at format_time(trend.trend.created_at)
json.name trend.trend&.title
json.created_at format_time(trend.trend&.created_at)
end

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

View File

@ -15,7 +15,7 @@ zh-CN:
'refused': '已拒绝'
'agreed': '已同意'
trend:
Issue: 工单
Issue: 易修(Issue)
PullRequest: 合并请求
VersionRelease: 版本发布
create: 创建了