handle the case where a file is uploaded that doesn't match whatever was preprocessed

This commit is contained in:
Albert Yi
2018-07-02 14:47:23 -07:00
parent 9a522d9fef
commit 867406f410
2 changed files with 19 additions and 2 deletions

View File

@@ -355,6 +355,12 @@ class UploadService
pred.initialize_attributes
pred.attributes = self.params
# if a file was uploaded after the preprocessing occurred,
# then process the file and overwrite whatever the preprocessor
# did
Utils.process_file(pred, pred.file) if pred.file.present?
pred.status = "completed"
pred.save
return pred