diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 917f3ad8e..26073d080 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -219,6 +219,13 @@ class SubjectsController < ApplicationController @shixun = Shixun.create!(name: params[:name], user_id: current_user.id, identifier: identifier) # 添加合作者 @shixun.shixun_members.create!(user_id: current_user.id, role: 1) + # 创建长字段 + @shixun.shixun_info.create!(description: "") + # 创建版本库 + repo_path = repo_namespace(current_user.login, identifier) + GitService.add_repository(repo_path: repo_path) + # todo: 为什么保存的时候要去除后面的.git呢?? + @shixun.update_column(:repo_name, repo_path.split(".")[0]) end end