From 13eebe4d7aea736594446345f151736ab986a479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 24 Sep 2021 21:18:41 +0200 Subject: [PATCH] Remove Wicked PDF monkey patch This patch was added in commit baefc249f because both ViewComponent and Wicked PDF monkey-patched the `render` method and so they were incompatible. However, Rails 6.1 includes the patch used by ViewComponent, meaning ViewComponent doesn't monkey-patch the `render` method anymore, and so it's compatible with Wicked PDF. --- config/initializers/wicked_pdf.rb | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/config/initializers/wicked_pdf.rb b/config/initializers/wicked_pdf.rb index 6befcabeb..8a4ead8ee 100644 --- a/config/initializers/wicked_pdf.rb +++ b/config/initializers/wicked_pdf.rb @@ -1,27 +1,3 @@ -class WickedPdf - # Wicked Pdf magic breaks ViewComponent - # https://github.com/mileszs/wicked_pdf/pull/925 - module PdfHelper - def render(*args) - options = args.first - if options.is_a?(Hash) && options.key?(:pdf) - render_with_wicked_pdf(options) - else - super - end - end - - def render_to_string(*args) - options = args.first - if options.is_a?(Hash) && options.key?(:pdf) - render_to_string_with_wicked_pdf(options) - else - super - end - end - end -end - # WickedPDF Global Configuration # # Use this to set up shared configuration options for your entire application.