add pj for export template
This commit is contained in:
parent
d1c3b84ea2
commit
24922605cd
2 changed files with 71 additions and 0 deletions
|
@ -22,6 +22,15 @@ class ExportTemplate < ApplicationRecord
|
|||
tiptap_content("pdf_name")
|
||||
end
|
||||
|
||||
def content_for_pj(pj)
|
||||
content_for_pj_id(pj.stable_id)&.to_json
|
||||
end
|
||||
|
||||
def content_for_pj_id(stable_id)
|
||||
content_for_stable_id = content["pjs"].find { _1.symbolize_keys[:stable_id] == stable_id.to_s }
|
||||
content_for_stable_id.symbolize_keys.fetch(:path)
|
||||
end
|
||||
|
||||
def attachment_and_path(dossier, attachment, index: 0, row_index: nil)
|
||||
[
|
||||
attachment,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue