Skip to content

Commit

Permalink
Improve handling local assets
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rky-pl committed Feb 2, 2024
1 parent 4c0b6fa commit 9adfa7a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/wicked_pdf/wicked_pdf_helper/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,8 @@ def find_asset(path)
elsif defined?(Propshaft::Assembly) && Rails.application.assets.is_a?(Propshaft::Assembly)
PropshaftAsset.new(Rails.application.assets.load_path.find(path))
elsif Rails.application.respond_to?(:assets_manifest)
if Rails.application.assets_manifest.assets[path]
LocalAsset.new(File.join(Rails.application.assets_manifest.dir, Rails.application.assets_manifest.assets[path]))
end
asset_path = File.join(Rails.application.assets_manifest.dir, Rails.application.assets_manifest.assets[path])
LocalAsset.new(asset_path) if File.file?(asset_path)
else
SprocketsEnvironment.find_asset(path, :base_path => Rails.application.root.to_s)
end
Expand Down

0 comments on commit 9adfa7a

Please sign in to comment.