diff --git a/app/services/subjects/copy_subject_service.rb b/app/services/subjects/copy_subject_service.rb index 5f8481cae..94157dc7b 100644 --- a/app/services/subjects/copy_subject_service.rb +++ b/app/services/subjects/copy_subject_service.rb @@ -5,7 +5,8 @@ class Subjects::CopySubjectService < ApplicationService @subject = subject @user = user @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) end @@ -59,7 +60,7 @@ class Subjects::CopySubjectService < ApplicationService shixun = stage_shixun.shixun to_shixun = Shixun.new 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.user_id = user.id if laboratory