From ce212ce6c60f882d86b3cd8066375a97d7521c5b Mon Sep 17 00:00:00 2001 From: qinmingyuan Date: Fri, 1 Dec 2023 12:23:29 +0800 Subject: [PATCH] fix file structs --- app/exporters/datum/pdf_exporter.rb | 2 +- app/models/datum/model/table_list.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/exporters/datum/pdf_exporter.rb b/app/exporters/datum/pdf_exporter.rb index b895d44..1c4ee95 100644 --- a/app/exporters/datum/pdf_exporter.rb +++ b/app/exporters/datum/pdf_exporter.rb @@ -1,6 +1,6 @@ require 'prawn/table' module Datum - class PdfExporter + class PdfExporter < CacheExporter def pdf if reportable.respond_to?(:pdf_object) diff --git a/app/models/datum/model/table_list.rb b/app/models/datum/model/table_list.rb index 2479621..94ede78 100644 --- a/app/models/datum/model/table_list.rb +++ b/app/models/datum/model/table_list.rb @@ -38,6 +38,11 @@ def convert_parameters params end + def to_pdf + export = PdfExporter.new(self) + export.run + end + def direct_xlsx export = XlsxExporter.new(export: self.data_list.export, params: self.parameters) export.run