Class: Workers::ProcessPhoto

Inherits:
Base
  • Object
show all
Defined in:
app/workers/process_photo.rb

Instance Method Summary collapse

Methods inherited from Base

#suppress_annoying_errors

Instance Method Details

#perform(id) ⇒ Object


10
11
12
13
14
15
16
17
18
19
# File 'app/workers/process_photo.rb', line 10

def perform(id)
  photo = Photo.find(id)
  unprocessed_image = photo.unprocessed_image

  return false if photo.processed? || unprocessed_image.path.try(:include?, ".gif")

  photo.processed_image.store!(unprocessed_image)

  photo.save!
end