mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
DEV: move user references deletion code to before_destroy
. (#10085)
Moving the `delete_source_user_references` method code from user merger service to user model.
This commit is contained in:
@ -2224,6 +2224,7 @@ describe User do
|
||||
UserAction.create!(user_id: user.id, action_type: UserAction::LIKE)
|
||||
UserAction.create!(user_id: -1, action_type: UserAction::LIKE, target_user_id: user.id)
|
||||
UserAction.create!(user_id: -1, action_type: UserAction::LIKE, acting_user_id: user.id)
|
||||
Developer.create!(user_id: user.id)
|
||||
|
||||
user.reload
|
||||
|
||||
@ -2233,6 +2234,7 @@ describe User do
|
||||
expect(UserAction.where(target_user_id: user.id).length).to eq(0)
|
||||
expect(UserAction.where(acting_user_id: user.id).length).to eq(0)
|
||||
expect(PostAction.with_deleted.where(user_id: user.id).length).to eq(0)
|
||||
expect(Developer.where(user_id: user.id).length).to eq(0)
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user