diff --git a/db/migrate/20190725024516_modify_attachment_url_for_challenge_answer.rb b/db/migrate/20190725024516_modify_attachment_url_for_challenge_answer.rb new file mode 100644 index 000000000..41840bac1 --- /dev/null +++ b/db/migrate/20190725024516_modify_attachment_url_for_challenge_answer.rb @@ -0,0 +1,7 @@ +class ModifyAttachmentUrlForChallengeAnswer < ActiveRecord::Migration[5.2] + def change + ChallengeChoose.find_each do |cc| + cc.update_column(:subject, cc.subject.gsub("(/attachments/download", "(/api/attachments")) if cc.subject.present? + end + end +end