mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-15 23:57:48 +00:00
Makes wicked-pdf config env dependent
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
Rails.application.reloader.to_prepare do
|
||||
WickedPdf.config = {
|
||||
#:wkhtmltopdf => '/usr/local/bin/wkhtmltopdf',
|
||||
#:layout => "pdf.html",
|
||||
:exe_path => `bundle exec which wkhtmltopdf`.chomp
|
||||
}
|
||||
if Rails.env.test?
|
||||
Rails.application.reloader.to_prepare do
|
||||
WickedPdf.config = {
|
||||
#:wkhtmltopdf => '/usr/local/bin/wkhtmltopdf',
|
||||
#:layout => "pdf.html",
|
||||
:page_size => 'A3',
|
||||
:exe_path => `bundle exec which wkhtmltopdf`.chomp
|
||||
}
|
||||
end
|
||||
else
|
||||
Rails.application.reloader.to_prepare do
|
||||
WickedPdf.config = {
|
||||
#:wkhtmltopdf => '/usr/local/bin/wkhtmltopdf',
|
||||
#:layout => "pdf.html",
|
||||
:page_size => 'A4', # default
|
||||
:exe_path => `bundle exec which wkhtmltopdf`.chomp
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
# A monkey-patch to remove WickedPdf's monkey-patch, as it clashes with ViewComponents.
|
||||
|
||||
Reference in New Issue
Block a user