Sha256: 039074e5013ed5e7e71af45a29ead91b63d0d853046a0ee3fceacdce991b7afb
Contents?: true
Size: 521 Bytes
Versions: 23
Compression:
Stored size: 521 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
23 entries across 23 versions & 1 rubygems