mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
DEV: Use UploadReference instead of ChatUpload in chat (#19947)
We've had the UploadReference table for some time now in core, but it was added after ChatUpload was and chat was just never moved over to this new system. This commit changes all chat code dealing with uploads to create/ update/delete/query UploadReference records instead of ChatUpload records for consistency. At a later date we will drop the ChatUpload table, but for now keeping it for data backup. The migration + post migration are the same, we need both in case any chat uploads are added/removed during deploy.
This commit is contained in:
@ -26,7 +26,7 @@ describe Chat do
|
||||
)
|
||||
end
|
||||
|
||||
it "marks uploads with ChatUpload in use" do
|
||||
it "marks uploads with reference to ChatMessage via UploadReference in use" do
|
||||
unused_upload
|
||||
|
||||
expect { Jobs::CleanUpUploads.new.execute({}) }.to change { Upload.count }.by(-1)
|
||||
@ -61,7 +61,7 @@ describe Chat do
|
||||
)
|
||||
end
|
||||
|
||||
it "marks uploads with ChatUpload in use" do
|
||||
it "marks uploads with reference to ChatMessage via UploadReference in use" do
|
||||
draft_upload
|
||||
unused_upload
|
||||
|
||||
|
Reference in New Issue
Block a user