ファイルの内容を読み取り、インデックスを作成するアプリケーションがあります。それらをディスク自体に保存していましたが、現在Amazon S3を使用しているため、次の方法は機能しなくなりました。
それはこのようなものでした:
def perform(docId)
@document = Document.find(docId)
if @document.file?
#You should't create a new version
@document.versionless do |doc|
@document.file_content = Cloudoc::Extractor.new.extract(@document.file.file)
@document.save
end
end
end
@document.file
を返し、クラスFileUploader
を返します。doc.file.file
CarrierWave::Storage::Fog::File
どうすれば実際のファイルを取得できますか?