From ec3ff13810e42489cd89664e0192a814ff15d41e Mon Sep 17 00:00:00 2001 From: Sebastian Gassner Date: Thu, 17 Mar 2016 13:44:14 +0100 Subject: [PATCH] Don't use Rails.application.assets. Fix #105. --- app/views/spree/admin/orders/invoice.pdf.prawn | 2 +- app/views/spree/admin/orders/packaging_slip.pdf.prawn | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/spree/admin/orders/invoice.pdf.prawn b/app/views/spree/admin/orders/invoice.pdf.prawn index b49c2f61..bd670b9c 100644 --- a/app/views/spree/admin/orders/invoice.pdf.prawn +++ b/app/views/spree/admin/orders/invoice.pdf.prawn @@ -5,7 +5,7 @@ define_grid(columns: 5, rows: 8, gutter: 10) # HEADER repeat(:all) do - im = Rails.application.assets.find_asset(Spree::PrintInvoice::Config[:logo_path]) + im = asset_path(Spree::PrintInvoice::Config[:logo_path]) if im && File.exist?(im.pathname) image im.filename, vposition: :top, height: 40, scale: Spree::PrintInvoice::Config[:logo_scale] diff --git a/app/views/spree/admin/orders/packaging_slip.pdf.prawn b/app/views/spree/admin/orders/packaging_slip.pdf.prawn index b8ea5304..891192ee 100755 --- a/app/views/spree/admin/orders/packaging_slip.pdf.prawn +++ b/app/views/spree/admin/orders/packaging_slip.pdf.prawn @@ -5,7 +5,8 @@ define_grid(columns: 5, rows: 8, gutter: 10) # HEADER repeat(:all) do - im = Rails.application.assets.find_asset(Spree::PrintInvoice::Config[:logo_path]) + im = asset_path(Spree::PrintInvoice::Config[:logo_path]) + if im && File.exist?(im.pathname) image im, vposition: :top, height: 40, scale: Spree::PrintInvoice::Config[:logo_scale] end