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: })