Skip to content
Browse files

Merge pull request #3135 from christos/respect_assets_digest_value

Give precedence to `config.digest = false` over the existence of manifest.yml asset digests
  • Loading branch information...
2 parents 3b87c38 + 793e9da commit 2c3a5075b683f079b6b53f121137d3c38e47a8ef @spastorino spastorino committed Sep 26, 2011
View
2 actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -118,7 +118,7 @@ def asset_for(source, ext)
end
def digest_for(logical_path)
- if asset_digests && (digest = asset_digests[logical_path])
+ if digest_assets && asset_digests && (digest = asset_digests[logical_path])
return digest
end
View
8 actionpack/test/template/sprockets_helper_test.rb
@@ -266,4 +266,12 @@ def url_for(*args)
assert_not_equal prod_path, dev_path
end
+
+ test "precedence of `config.digest = false` over manifest.yml asset digests" do
+ Rails.application.config.assets.digests = {'logo.png' => 'logo-d1g3st.png'}
+ @config.assets.digest = false
+
+ assert_match %r{/assets/logo.png},
+ asset_path("logo.png")
+ end
end

0 comments on commit 2c3a507

Please sign in to comment.
Something went wrong with that request. Please try again.