]> cat aescling's git repositories - mastodon.git/commitdiff
Add Rake task to backfill local-only flag (#253)
authorDavid Yip <yipdw@member.fsf.org>
Mon, 11 Dec 2017 04:49:59 +0000 (22:49 -0600)
committerDavid Yip <yipdw@member.fsf.org>
Mon, 11 Dec 2017 04:49:59 +0000 (22:49 -0600)
lib/tasks/glitchsoc.rake [new file with mode: 0644]

diff --git a/lib/tasks/glitchsoc.rake b/lib/tasks/glitchsoc.rake
new file mode 100644 (file)
index 0000000..79e8646
--- /dev/null
@@ -0,0 +1,8 @@
+namespace :glitchsoc do
+  desc 'Backfill local-only flag on statuses table'
+  task backfill_local_only: :environment do
+    Status.local.where(local_only: nil).find_each do |st|
+      ActiveRecord::Base.logger.silence { st.update_attribute(:local_only, st.marked_local_only?) }
+    end
+  end
+end