Sha256: d69dbca1d5b2a0667516ee2178d0cd810801c8b0ba976ce884c5af1657951cfe
Contents?: true
Size: 749 Bytes
Versions: 36
Compression:
Stored size: 749 Bytes
Contents
module Pageflow class UploadFileToS3Job @queue = :slow extend StateMachineJob def self.perform_with_result(file, options = {}) if file && file.attachment_on_filesystem.file? if File.exists?(file.attachment_on_filesystem.path) file.attachment_on_s3 = file.attachment_on_filesystem file.save! file.attachment_on_filesystem.destroy unless file.keep_on_filesystem_after_upload_to_s3? :ok else logger.info "#{file.class.name} #{file.id} not yet transfered to instance." :pending end else logger.warn "#{file.class.name} #{file.id} does not have an attachment on the file system. ignoring." :error end end end end
Version data entries
36 entries across 36 versions & 1 rubygems