Skip to content

Commit 4844424

Browse files
committed
Merge pull request #251 from rails/rollback-asset-alias-check
Revert asset alias check
2 parents 18bc1a0 + 401ee1c commit 4844424

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

lib/sprockets/rails/helper.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ def initialize(source)
1515
end
1616
end
1717

18-
class AssetAliasUsed < StandardError
19-
def initialize(actual, expected)
20-
msg = "Asset was linked to from an alias rather than its exact path. " +
21-
"Alias resolving may not be available in production.\n" +
22-
"Use #{expected.inspect} instead of #{actual.inspect}"
23-
super(msg)
24-
end
25-
end
26-
2718
include ActionView::Helpers::AssetUrlHelper
2819
include ActionView::Helpers::AssetTagHelper
2920

@@ -89,10 +80,6 @@ def asset_digest_path(path, options = {})
8980
if environment = assets_environment
9081
if asset = environment[path]
9182
unless options[:debug]
92-
if path != asset.logical_path
93-
raise AssetAliasUsed.new(path, asset.logical_path)
94-
end
95-
9683
if !precompiled_assets.include?(asset)
9784
raise AssetNotPrecompiled.new(asset.logical_path)
9885
end

test/test_helper.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -664,26 +664,6 @@ def test_precompile_allows_links
664664
end
665665
end
666666

667-
def test_asset_path_with_index_requires_exact_logical_path
668-
@view.assets_precompile = ["bundle.js"]
669-
670-
assert @view.asset_path("bundle.js")
671-
672-
assert_raises(Sprockets::Rails::Helper::AssetAliasUsed) do
673-
assert @view.asset_path("bundle/index.js")
674-
end
675-
end
676-
677-
def test_asset_path_with_bower_requires_exact_logical_path
678-
@view.assets_precompile = ["jquery/jquery.js"]
679-
680-
assert @view.asset_path("jquery/jquery.js")
681-
682-
assert_raises(Sprockets::Rails::Helper::AssetAliasUsed) do
683-
assert @view.asset_path("jquery.js")
684-
end
685-
end
686-
687667
def test_links_image_target
688668
assert_match "logo.png", @assets['url.css'].links.to_a[0]
689669
end

0 commit comments

Comments
 (0)