PERF: delete potentially large associated tables before user_destroyer.destroy transaction

This commit is contained in:
Maja Komel
2019-01-18 16:04:29 +01:00
parent 78362448bc
commit 45f66826ee
3 changed files with 14 additions and 1 deletions

View File

@ -409,6 +409,7 @@ class Admin::UsersController < Admin::AdminController
options = params.slice(:block_email, :block_urls, :block_ip, :context, :delete_as_spammer)
options[:delete_posts] = ActiveModel::Type::Boolean.new.cast(params[:delete_posts])
options[:prepare_for_destroy] = true
hijack do
begin