I have an application that reads the contents of a file and indexes it. I kept them on disk, but now I use Amazon S3, so the following method no longer works.
It was something like this:
def perform(docId)
@document = Document.find(docId)
if @document.file?
@document.versionless do |doc|
@document.file_content = Cloudoc::Extractor.new.extract(@document.file.file)
@document.save
end
end
end
@document.filereturns FileUploaderand doc.file.filereturns the class CarrierWave::Storage::Fog::File.
How can I get a real file?
source
share