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:
parent
66582ed956
commit
26b4dbde41
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue