PERF: use delete_all to remove notifications and topic_users

Previously we used destroy here which could be extremely expensive
This commit is contained in:
Sam Saffron 2019-04-26 22:26:31 +10:00
parent 66582ed956
commit 26b4dbde41
1 changed files with 2 additions and 2 deletions

View File

@ -22,8 +22,8 @@ class User < ActiveRecord::Base
include HasDestroyedWebHook
has_many :posts
has_many :notifications, dependent: :destroy
has_many :topic_users, dependent: :destroy
has_many :notifications, dependent: :delete_all
has_many :topic_users, dependent: :delete_all
has_many :category_users, dependent: :destroy
has_many :tag_users, dependent: :destroy
has_many :user_api_keys, dependent: :destroy