controllers: disable explicit purge of invalid file

This commit is contained in:
Pierre de La Morinerie 2020-06-24 17:25:32 +02:00
parent 719915e69f
commit b8706757e3
2 changed files with 1 additions and 7 deletions

View file

@ -9,12 +9,6 @@ class Champs::PieceJustificativeController < ApplicationController
render :show
else
errors = @champ.errors.full_messages
# Before Rails 6, the attachment was persisted to database
# by 'attach', even before calling save.
# So until we're on Rails 6, we need to purge the file explicitely.
@champ.piece_justificative_file.purge_later
render :json => { errors: errors }, :status => 422
end
end