From: Tom Hughes Date: Thu, 11 Feb 2016 10:15:19 +0000 (+0000) Subject: Avoid using Rails.application.assets as it no longer set in production X-Git-Tag: live~3919 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/be624d64f395c40a78249754825cecdd9b050398?hp=8008dc9ccb1ca351a9e6c32606683b349a69e77b Avoid using Rails.application.assets as it no longer set in production --- diff --git a/app/helpers/asset_helper.rb b/app/helpers/asset_helper.rb index 5b0740735..40782fbcf 100644 --- a/app/helpers/asset_helper.rb +++ b/app/helpers/asset_helper.rb @@ -1,11 +1,7 @@ module AssetHelper def assets(directory) - assets = {} - - Rails.application.assets.index.each_logical_path("#{directory}/*") do |path| - assets[path.sub(%r{^#{directory}/}, "")] = asset_path(path) + Rails.application.assets_manifest.assets.keys.each_with_object({}) do |asset, assets| + assets[asset] = asset_path(asset) if asset.start_with?("#{directory}/") end - - assets end end