From ac3d87cf93e1500d47135049092621cebe485370 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 17:26:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20191226092304_modify_task_pass_2_for_challenges.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 db/migrate/20191226092304_modify_task_pass_2_for_challenges.rb diff --git a/db/migrate/20191226092304_modify_task_pass_2_for_challenges.rb b/db/migrate/20191226092304_modify_task_pass_2_for_challenges.rb new file mode 100644 index 000000000..f03039aa2 --- /dev/null +++ b/db/migrate/20191226092304_modify_task_pass_2_for_challenges.rb @@ -0,0 +1,8 @@ +class ModifyTaskPass2ForChallenges < ActiveRecord::Migration[5.2] + def change + challenges = Challenge.where("task_pass like '%frac%'") + challenges.find_each do |c| + c.update_column(:task_pass, c.task_pass.gsub('\f\frac', '\frac')) + end + end +end