From e7fa81a44f17077c9e9f9699bf8703ebc90dad0b Mon Sep 17 00:00:00 2001 From: Lhc_fl Date: Mon, 26 Aug 2024 11:52:36 +0800 Subject: [PATCH] fix skip empty --- lib/report_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/report_generator.rb b/lib/report_generator.rb index 80285629..4ecb4c63 100644 --- a/lib/report_generator.rb +++ b/lib/report_generator.rb @@ -12,7 +12,7 @@ def self.generate(query_id, query_params, recipients, opts = {}) result = DataExplorer.run_query(query, params) query.update!(last_run_at: Time.now) - return [] if opts[:skip_empty] && result.values.empty? + return [] if opts[:skip_empty] && result[:pg_result].values.empty? table = ResultToMarkdown.convert(result[:pg_result]) build_report_pms(query, table, recipients, opts: { attach_csv: opts[:attach_csv], result: })