Class: Pageflow::ProcessImageFileJob

Inherits:
Object
  • Object
show all
Extended by:
StateMachineJob
Defined in:
app/jobs/pageflow/process_image_file_job.rb

Class Method Summary collapse

Class Method Details

.perform_with_result(image_file, options) ⇒ Object


7
8
9
10
11
12
13
14
15
16
# File 'app/jobs/pageflow/process_image_file_job.rb', line 7

def self.perform_with_result(image_file, options)
  image_file.processed_attachment = image_file.unprocessed_attachment
  image_file.save!

  :ok
rescue ActiveRecord::RecordInvalid, Errno::ENAMETOOLONG
  image_file.processed_attachment = nil
  image_file.save!
  :error
end