Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7672 from wagenet/asset_path_digest_fix

Respect `config.digest = false` for `asset_path`
  • Loading branch information...
commit 7c5454e555c3928604c9d4b753c7a8ff73378932 2 parents 24a7774 + 1ac19c1
@rafaelfranca rafaelfranca authored
View
9 actionpack/CHANGELOG.md
@@ -1,5 +1,14 @@
## Rails 3.2.9 (unreleased) ##
+* 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.