aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/sprockets
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-06-08 00:14:05 +0200
committerPiotr Sarnacki <drogus@gmail.com>2012-06-08 00:15:52 +0200
commitfa352c46da1b89534f2ddb04a602b7d09c0f5872 (patch)
tree4796d73a2a72665fa2e9ee026caee87f29a9ede6 /actionpack/lib/sprockets
parent5b0a8916ea5a7c565aaf27964bf19a8f3bf5f558 (diff)
downloadrails-fa352c46da1b89534f2ddb04a602b7d09c0f5872.tar.gz
rails-fa352c46da1b89534f2ddb04a602b7d09c0f5872.tar.bz2
rails-fa352c46da1b89534f2ddb04a602b7d09c0f5872.zip
Fix railties test suite
Apparently asset_environment should not be invoked if it's not needed. This fixes broken build by getting back to the code more similar to the version changed here: 5b0a891
Diffstat (limited to 'actionpack/lib/sprockets')
-rw-r--r--actionpack/lib/sprockets/helpers/rails_helper.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb
index 37c37604d5..8f0e0f8ee1 100644
--- a/actionpack/lib/sprockets/helpers/rails_helper.rb
+++ b/actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -157,8 +157,7 @@ module Sprockets
def rewrite_extension(source, dir, ext)
source_ext = File.extname(source)
if ext && source_ext != ".#{ext}"
- asset = asset_environment[source]
- if !source_ext.empty? && asset &&
+ if !source_ext.empty? && (asset = asset_environment[source]) &&
asset.pathname.to_s =~ /#{source}\Z/
source
else