Permalink
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...
1 parent 9d07ace commit 98f80218d4a588bd4bcace2ae534b9a791d381f9 @rafaelfranca rafaelfranca committed Sep 20, 2012
View
@@ -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*
@@ -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
@@ -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

0 comments on commit 98f8021

Please sign in to comment.