diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-20 19:48:08 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-20 19:54:14 -0300 |
commit | 98f80218d4a588bd4bcace2ae534b9a791d381f9 (patch) | |
tree | 42d95b39ee942520f5c0db09444bdc2791b456c2 | |
parent | 9d07aceb504c0730d5777624d1c3ff77addc61a0 (diff) | |
download | rails-98f80218d4a588bd4bcace2ae534b9a791d381f9.tar.gz rails-98f80218d4a588bd4bcace2ae534b9a791d381f9.tar.bz2 rails-98f80218d4a588bd4bcace2ae534b9a791d381f9.zip |
Revert "Revert "Respect `config.digest = false` for `asset_path`""
This reverts commit 54f55746a70a7091341e84236498203118a7fbb4.
Reason: the last commit fixed the failing case
-rw-r--r-- | actionpack/CHANGELOG.md | 9 | ||||
-rw-r--r-- | actionpack/lib/sprockets/helpers/rails_helper.rb | 4 | ||||
-rw-r--r-- | actionpack/test/template/sprockets_helper_test.rb | 8 |
3 files changed, 20 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 222777306d..e86008d26c 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -10,6 +10,15 @@ *Luiz Felipe Garcia Pereira* +* Respect `config.digest = false` for `asset_path` + + Previously, the `asset_path` internals only respected the `:digest` + option, but ignored the global config setting. This meant that + `config.digest = false` could not be used in conjunction with + `config.compile = false` this corrects the behavior. + + *Peter Wagenet* + * Fix #7646, the log now displays the correct status code when an exception is raised. *Yves Senn* diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index 8f0e0f8ee1..690c71b472 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -147,7 +147,9 @@ module Sprockets if source[0] == ?/ source else - source = digest_for(source) unless options[:digest] == false + if digest_assets && options[:digest] != false + source = digest_for(source) + end source = File.join(dir, source) source = "/#{source}" unless source =~ /^\// source diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index b908b6777c..72d03e43e9 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -360,4 +360,12 @@ class SprocketsHelperTest < ActionView::TestCase assert_equal '/assets/logo.png', asset_path("logo.png") end + + test "`config.digest = false` works with `config.compile = false`" do + @config.assets.digest = false + @config.assets.compile = false + + assert_equal '/assets/logo.png', + asset_path("logo.png") + end end |