From 41f2210fcd0893b7d7ab0a92680d7d7f7804b66f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 11 Dec 2019 09:27:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=AE=9E=E8=AE=AD=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- app/services/shixuns/create_shixun_service.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index f5c951836..e49057a5e 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -365,7 +365,7 @@ class ShixunsController < ApplicationController def create begin - @shixun = CreateShixunService.call(current_user, shixun_params, params) + @shixun = CreateShixunService.call(current_user, shixun_params, params) rescue => e logger_error("shixun_create_error: #{e.message}") tip_exception("创建实训失败!") diff --git a/app/services/shixuns/create_shixun_service.rb b/app/services/shixuns/create_shixun_service.rb index cf40c55ab..921b41931 100644 --- a/app/services/shixuns/create_shixun_service.rb +++ b/app/services/shixuns/create_shixun_service.rb @@ -11,6 +11,7 @@ class CreateShixunService < ApplicationService shixun = Shixun.new(permit_params) identifier = Util::UUID.generate_identifier(Shixun, 8) shixun.identifier= identifier + shixun.user_id = user.id main_mirror = MirrorRepository.find params[:main_type] sub_mirrors = MirrorRepository.where(id: params[:sub_type]) ActiveRecord::Base.transaction do