Class: Lcms::Engine::MaterialGenerateJob

Inherits:
ApplicationJob
  • Object
show all
Includes:
ResqueJob
Defined in:
app/jobs/lcms/engine/material_generate_job.rb

Instance Method Summary collapse

Methods included from ResqueJob

included, #result_key, #store_initial_result, #store_result

Instance Method Details

#perform(material, document) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'app/jobs/lcms/engine/material_generate_job.rb', line 10

def perform(material, document)
  if document.math?
    material.document_parts.default.each { |p| p.update!(content: EmbedEquations.call(p.content)) }
  end

  DocumentGenerator.material_generators.each do |klass|
    klass.constantize.perform_later material, document
  end
end