class DocumentExporter::PDF::TeacherMaterial

Public Instance Methods

export() click to toggle source
Calls superclass method DocumentExporter::PDF::Base#export
# File lib/document_exporter/pdf/teacher_material.rb, line 6
def export
  content = super
  pdf = CombinePDF.parse(content)

  scope = @document.teacher_materials.where(id: included_materials)
  material_ids = ordered_materials scope.pluck(:id)
  pdf = combine_pdf_for pdf, material_ids
  pdf.to_pdf
end