Merge pull request #2140 from biosistemika/revert-2139-ai-sci-fix-office-save

Revert "Force save office file"
This commit is contained in:
aignatov-bio 2019-10-08 21:34:35 +02:00 committed by GitHub
commit 53adea97ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -396,8 +396,7 @@ class Asset < ApplicationRecord
end
def update_contents(new_file)
to_blob = ActiveStorage::Blob.create_after_upload!(io: new_file, filename: file_name)
file.attach(to_blob)
file.attach(io: new_file, filename: file_name)
self.version = version.nil? ? 1 : version + 1
save
end