Sha256: d3d3f804f61e35f9079a9a153d09202348d4f8ceb257b999d89042f8b7c3fa1e
Contents?: true
Size: 520 Bytes
Versions: 3
Compression:
Stored size: 520 Bytes
Contents
# frozen_string_literal: true class DestroyDeletedUsersFollows < ActiveRecord::Migration[5.2] class Follow < ApplicationRecord self.table_name = "decidim_follows" end class User < ApplicationRecord self.table_name = "decidim_users" end def change deleted_users = User.where.not(deleted_at: nil).pluck(:id) Follow.where(decidim_followable_type: "Decidim::UserBaseEntity", decidim_followable_id: deleted_users).destroy_all Follow.where(decidim_user_id: deleted_users).destroy_all end end
Version data entries
3 entries across 3 versions & 1 rubygems