forked from Gitlink/forgeplus
Merge branch 'pre_trustie_server' into trustie_server
This commit is contained in:
commit
bc8f032f2f
|
@ -209,7 +209,7 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def fork_users
|
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
|
@forks_count = fork_users.size
|
||||||
@fork_users = paginate(fork_users)
|
@fork_users = paginate(fork_users)
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
class ForkUser < ApplicationRecord
|
class ForkUser < ApplicationRecord
|
||||||
belongs_to :project
|
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
|
belongs_to :fork_project, class_name: 'Project', foreign_key: :fork_project_id
|
||||||
|
|
||||||
after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic
|
after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
json.count @forks_count
|
json.count @forks_count
|
||||||
json.users do
|
json.users do
|
||||||
json.array! @fork_users.each do |f|
|
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.id f.fork_project.id
|
||||||
json.identifier f.fork_project.identifier
|
json.identifier f.fork_project.identifier
|
||||||
json.name "#{user.try(:show_real_name)}/#{f.fork_project.try(:name)}"
|
json.name "#{user.try(:show_real_name)}/#{f.fork_project.try(:name)}"
|
||||||
|
|
Loading…
Reference in New Issue