Merge branch 'standalone_develop' into pre_trustie_server

This commit is contained in:
yystopf 2022-05-07 11:58:24 +08:00
commit 0d377943d5
3 changed files with 3 additions and 3 deletions

View File

@ -209,7 +209,7 @@ class ProjectsController < ApplicationController
end
def fork_users
fork_users = @project.fork_users.includes(:user, :project, :fork_project).order("fork_users.created_at desc").distinct
fork_users = @project.fork_users.includes(:owner, :project, :fork_project).order("fork_users.created_at desc").distinct
@forks_count = fork_users.size
@fork_users = paginate(fork_users)
end

View File

@ -17,7 +17,7 @@
class ForkUser < ApplicationRecord
belongs_to :project
belongs_to :owner
belongs_to :owner, class_name: 'Owner', foreign_key: :user_id
belongs_to :fork_project, class_name: 'Project', foreign_key: :fork_project_id
after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic

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)}"