Files
gitlink-forgeplus/app/views/repositories/commits.json.jbuilder
sylor_huang@126.com 9498c438cd 修改hash_commit的json
2020-04-22 14:33:58 +08:00

18 lines
608 B
Ruby

Rails.logger.info("#######_______@hash_commit______############{@hash_commit}")
if @hash_commit[:status].present? #如果有状态值,则表示报错了
json.total_count 0
json.commits []
else
json.total_count @hash_commit[:total_count]
json.commits do
json.array! @hash_commit[:body] do |commit|
json.sha commit['sha']
json.message commit['commit']['message']
json.timestamp render_unix_time(commit['commit']['author']['date'])
json.time_from_now time_from_now(commit['commit']['author']['date'])
json.partial! 'author', user: @project.owner
end
end
end