From 64dcbba6aded3b8d0e5082f93d6740d17e47ff53 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 25 Jul 2019 10:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E5=9B=BE=E7=89=87=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...725024516_modify_attachment_url_for_challenge_answer.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 db/migrate/20190725024516_modify_attachment_url_for_challenge_answer.rb 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