Merge branch 'dev_aliyun' into dev_item_bank

dev_jupyter
daiao 5 years ago
commit deb1fc90e4

@ -44,12 +44,13 @@ class HacksController < ApplicationController
begin
logger.info("##########{hack_params}")
hack = Hack.new(hack_params)
hack.user_id = current_user.id
hack.identifier = generate_identifier Hack, 8
ActiveRecord::Base.transaction do
hack.user_id = current_user.id
hack.identifier = generate_identifier Hack, 8
hack.save!
# 创建测试集与代码
hack.hack_sets.create!(hack_sets_params)
# 新建知识点
hack_codes = hack.hack_codes.new(hack_code_params)
hack_codes.modify_time = Time.now
hack_codes.save!

Loading…
Cancel
Save