Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Revert "Respect `config.digest = false` for `asset_path`""

This reverts commit 54f5574.

Reason: the last commit fixed the failing case
  • Loading branch information...
commit 98f80218d4a588bd4bcace2ae534b9a791d381f9 1 parent 9d07ace
@rafaelfranca rafaelfranca authored
View
9 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*
View
4 actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -147,7 +147,9 @@ def rewrite_asset_path(source, dir, options = {})
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
View
8 actionpack/test/template/sprockets_helper_test.rb
@@ -360,4 +360,12 @@ def compute_host(source, request, options = {})
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
Please sign in to comment.
Something went wrong with that request. Please try again.