From 85dcab0a8886a1745817a318270f4ab8e61f37b7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 28 Nov 2019 08:06:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) 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