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.
This commit is contained in:
Javi Martín
2021-09-24 21:18:41 +02:00
parent 6e9df3be5a
commit 13eebe4d7a

View File

@@ -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 # WickedPDF Global Configuration
# #
# Use this to set up shared configuration options for your entire application. # Use this to set up shared configuration options for your entire application.