diff --git a/app/models/hack.rb b/app/models/hack.rb index 21ce27443..be1d60060 100644 --- a/app/models/hack.rb +++ b/app/models/hack.rb @@ -66,7 +66,7 @@ class Hack < ApplicationRecord # 复制fork def fork new_hack = Hack.new - new_hack.attributes = self.attributes.dup.except("id", "user_id", "status", "identifier", "comments_count", "praises_count", + new_hack.attributes = self.attributes.dup.except("id", "user_id", "identifier", "comments_count", "praises_count", "pass_num", "created_at", "updated_at", "hack_user_lastest_codes_count", "open_or_not", "submit_num") new_hack.user_id = User.current.id diff --git a/app/services/examination_banks/send_to_course_service.rb b/app/services/examination_banks/send_to_course_service.rb index 012aa282b..2aef9bad3 100644 --- a/app/services/examination_banks/send_to_course_service.rb +++ b/app/services/examination_banks/send_to_course_service.rb @@ -22,6 +22,7 @@ class ExaminationBanks::SendToCourseService < ApplicationService if item.item_type == "PROGRAM" new_hack = item.container.fork + new_hack.update!(status: 1) question.hack_id = new_hack.id question.save! else