If pj is missing do not crash

This commit is contained in:
Mathieu Magnin 2017-11-28 16:06:19 +01:00
parent 47a10b268c
commit 30d9f4721b

View file

@ -11,6 +11,7 @@ namespace :'2017_10_30_copy_commentaire_piece_justificative_to_file' do
def process_commentaire commentaire
puts "Processing commentaire #{commentaire.id}"
if commentaire.piece_justificative.present?
# https://github.com/carrierwaveuploader/carrierwave#uploading-files-from-a-remote-location
commentaire.remote_file_url = commentaire.piece_justificative.content_url
@ -24,3 +25,4 @@ namespace :'2017_10_30_copy_commentaire_piece_justificative_to_file' do
end
end
end
end