Skip to content

Commit 5e48117

Browse files
author
Gogs
committed
Delete file from file system on document deletion
1 parent 50577dc commit 5e48117

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

app/controllers/documents_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ def update
6868

6969
# DELETE /documents/:id
7070
def destroy
71+
@filename = Settings.document_folder + @document.document_url
72+
File.delete(@filename) if File.exist?(@filename)
73+
7174
@document.destroy
7275
head :no_content
7376
end

0 commit comments

Comments
 (0)