Sha256: 813a11efcbb62284401db6b32fa1cec00efd2a56272cd74294033dde1f71afc4
Contents?: true
Size: 566 Bytes
Versions: 15
Compression:
Stored size: 566 Bytes
Contents
module Pageflow class ProcessFileJob < ApplicationJob queue_as :resizing include StateMachineJob def perform_with_result(file, _options) file.attachment.reprocess! if file.valid? :ok else reset_invalid_attachment(file) :error end rescue ActiveRecord::RecordInvalid, Errno::ENAMETOOLONG reset_invalid_attachment(file) :error end def reset_invalid_attachment(file) file_name = file.file_name file.attachment = nil file.file_name = file_name end end end
Version data entries
15 entries across 15 versions & 1 rubygems