From e0a3c81fa260461f98ea8cc8a8921b87bcc2c83d Mon Sep 17 00:00:00 2001 From: Bolo Michelin Date: Thu, 2 Mar 2023 14:51:21 -0400 Subject: [PATCH] Replace deprecated 'render :text' with 'render plain' for plain text rendering --- lib/rgviz_rails/init.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/rgviz_rails/init.rb b/lib/rgviz_rails/init.rb index 235c9a4..a0952f6 100644 --- a/lib/rgviz_rails/init.rb +++ b/lib/rgviz_rails/init.rb @@ -38,29 +38,29 @@ def render_with_rgviz(*args, &block) case tqx['out'] when 'json' - render_without_rgviz :text => Rgviz::JsRenderer.render(table, tqx) + render_without_rgviz plain: Rgviz::JsRenderer.render(table, tqx) when 'html' - render_without_rgviz :text => Rgviz::HtmlRenderer.render(table) + render_without_rgviz plain: Rgviz::HtmlRenderer.render(table) when 'csv' csv_output = Rgviz::CsvRenderer.render(table) if tqx['outFileName'] send_data csv_output, :filename => tqx['outFileName'], :type => 'text/csv' else - render_without_rgviz :text => csv_output + render_without_rgviz plain: csv_output end else - render_without_rgviz :text => Rgviz::JsRenderer.render_error('not_supported', "Unsupported output type: #{out}", tqx) + render_without_rgviz plain: Rgviz::JsRenderer.render_error('not_supported', "Unsupported output type: #{out}", tqx) end rescue Exception => e case tqx['out'] when 'json' - render_without_rgviz :text => Rgviz::JsRenderer.render_error('invalid_query', e.message, tqx) + render_without_rgviz plain: Rgviz::JsRenderer.render_error('invalid_query', e.message, tqx) when 'html' - render_without_rgviz :text => "Error: #{e.message}" + render_without_rgviz plain: "Error: #{e.message}" when 'csv' - render_without_rgviz :text => "Error: #{e.message}" + render_without_rgviz plain: "Error: #{e.message}" else - render_without_rgviz :text => "Unsupported output type: #{out}" + render_without_rgviz plain: "Unsupported output type: #{out}" end end end