From 64da28192ff22fdd5f4639dc971116644d4b26e7 Mon Sep 17 00:00:00 2001 From: ayuki_j <19406594+ayuki-joto@users.noreply.github.com> Date: Mon, 12 Sep 2022 18:16:50 +0900 Subject: [PATCH] feat: add replace to null ParticipatoryProcess command --- lib/tasks/replace_to_null.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/tasks/replace_to_null.rake b/lib/tasks/replace_to_null.rake index e6bc7898a..108a2be30 100644 --- a/lib/tasks/replace_to_null.rake +++ b/lib/tasks/replace_to_null.rake @@ -16,4 +16,14 @@ namespace :replace_to_null do end end end + + desc 'fix participatory_processes edit bug.Make all "" columns of decidim_participatory_processes table null' + task decidim_participatory_processes: :environment do + Decidim::ParticipatoryProcess.transaction do + Decidim::ParticipatoryProcess.all.each do |org| + org.announcement = nil if org.announcement == "" + org.save! + end + end + end end