fork实践课程的章节数,关卡数和实训的关卡数不对

dev_home
daiao 5 years ago
parent 733bb1ab6e
commit 4dc7296b24

@ -5,7 +5,8 @@ class Subjects::CopySubjectService < ApplicationService
@subject = subject @subject = subject
@user = user @user = user
@laboratory = laboratory @laboratory = laboratory
subject_params = subject.attributes.dup.except('id', 'copy_subject_id', 'user_id', 'homepage_show') subject_params = subject.attributes.dup.except('id', 'copy_subject_id', 'user_id', 'homepage_show',
'stages_count', 'shixuns_count', 'stage_shixuns_count')
@to_subject = Subject.new(subject_params) @to_subject = Subject.new(subject_params)
end end
@ -59,7 +60,7 @@ class Subjects::CopySubjectService < ApplicationService
shixun = stage_shixun.shixun shixun = stage_shixun.shixun
to_shixun = Shixun.new to_shixun = Shixun.new
to_shixun.attributes = shixun.attributes.dup.except('id', 'user_id', 'identifier', 'homepage_show', to_shixun.attributes = shixun.attributes.dup.except('id', 'user_id', 'identifier', 'homepage_show',
'use_scope', 'averge_star', 'myshixuns_count') 'use_scope', 'averge_star', 'myshixuns_count', 'challenges_count')
to_shixun.identifier = Util::UUID.generate_identifier(Shixun, 8) to_shixun.identifier = Util::UUID.generate_identifier(Shixun, 8)
to_shixun.user_id = user.id to_shixun.user_id = user.id
if laboratory if laboratory

Loading…
Cancel
Save