fix: change owner must fix foreign_key

This commit is contained in:
2022-05-07 11:57:58 +08:00
parent 000197b0d1
commit a6cee63d17
3 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
json.count @forks_count
json.users do
json.array! @fork_users.each do |f|
user = f.user.present? ? f.user : Organization.find_by(id: f.user_id)
user = f.owner.present? ? f.owner : Organization.find_by(id: f.user_id)
json.id f.fork_project.id
json.identifier f.fork_project.identifier
json.name "#{user.try(:show_real_name)}/#{f.fork_project.try(:name)}"