From c3ad3bf8d5c78757746a9c81815af2f6962c4196 Mon Sep 17 00:00:00 2001 From: Leonid Medovyy Date: Fri, 28 Jul 2023 08:29:04 -0700 Subject: [PATCH] added a commented out maintenace task --- lib/tasks/blueprints.rake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tasks/blueprints.rake b/lib/tasks/blueprints.rake index bd790a3..1f1de9d 100644 --- a/lib/tasks/blueprints.rake +++ b/lib/tasks/blueprints.rake @@ -38,5 +38,8 @@ namespace :blueprints do # delete unprocessed stories with inactive subtopics dead_stories = Story.unprocessed.joins(:sub_topic).where(sub_topics: { active: false }) dead_stories.destroy_all + + # Retroactively disapprove of tweets with disabled subtopic + # Story.joins(:sub_topic).where(sub_topic: { active: false }).joins(discussion: :tweet).each { |s| s.discussion.tweet.update(approved: false) } end end