VRFS-3936 had to tweak mobile recording uploads

This commit is contained in:
Jonathan Kolyer 2017-04-20 01:06:25 -07:00
parent cd762dcd15
commit afe8380280
1 changed files with 5 additions and 1 deletions

View File

@ -28,8 +28,12 @@ module JamRuby
# save first to get a valid created_at time
mru.save!
# CarrierWave says we need a file extension, doesn't get provided
tmpfile = Tempfile.new([file_name, File.extname(file_name)])
tmpfile.write(file)
# now that the model exists (created_at exists), we can save the file in the correct path
mru.file_url = file
mru.file_url = tmpfile
mru.save
mru
end