diff options
author | Christos Zisopoulos <christos@me.com> | 2011-09-26 14:27:04 +0200 |
---|---|---|
committer | Christos Zisopoulos <christos@me.com> | 2011-09-26 14:27:04 +0200 |
commit | 793e9da63d74a082281d41c2bc90e7bd02adcde4 (patch) | |
tree | 15749149aae3e18fa209bd99416ce35ad4e53539 | |
parent | a15424b92c182bcc4d2b693dc0001a44c9b0802f (diff) | |
download | rails-793e9da63d74a082281d41c2bc90e7bd02adcde4.tar.gz rails-793e9da63d74a082281d41c2bc90e7bd02adcde4.tar.bz2 rails-793e9da63d74a082281d41c2bc90e7bd02adcde4.zip |
Give precedence to `config.digest = false` over manifest.yml asset digests
-rw-r--r-- | actionpack/lib/sprockets/helpers/rails_helper.rb | 2 | ||||
-rw-r--r-- | actionpack/test/template/sprockets_helper_test.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index fe822b338e..1e0e9bef77 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -114,7 +114,7 @@ module Sprockets 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 diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index a44a16750f..71768f4f5f 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -262,4 +262,12 @@ class SprocketsHelperTest < ActionView::TestCase 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 |