lib/paperweight/post_process_job.rb in paperweight-1.0.0 vs lib/paperweight/post_process_job.rb in paperweight-1.0.1
- old
+ new
@@ -5,11 +5,13 @@
class PostProcessJob < ActiveJob::Base
queue_as :default
discard_on ActiveJob::DeserializationError
- def perform(model, name, url)
- tempfile = Download.new.download(url)
- model.update!(name => tempfile, :"#{name}_processing" => nil)
+ def perform(model, name)
+ processing = :"#{name}_processing"
+
+ tempfile = Download.new.download(model.public_send(processing))
+ model.update!(name => tempfile, processing => nil)
end
end
end