Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rails/rails
...
head fork: rails/rails
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 2 contributors
Commits on Mar 20, 2013
@fredwu fredwu Fixed assets loading performance in 3.2.13
The PR #8756 uses Sprockets for resolving files that already exists on disk, for those files their extensions don't need to be rewritten.

Fixes #9803
687e68d
@fredwu fredwu Added changelog for 687e68d 38d0647
@tenderlove tenderlove Merge branch '3-2-stable' into fredwu-slow_view_loading_fix
* 3-2-stable:
  Merge pull request #9802 from newsline/fix-broken-action-missing
  Remove bad changelog entry from AR [ci skip]
  Wrong exception is occured when raising no translatable exception
  Don't crash exception translation w/ nil result attribute.

Conflicts:
	actionpack/CHANGELOG.md
d1577cf
View
6 actionpack/CHANGELOG.md
@@ -1,5 +1,11 @@
## unreleased ##
+* Fixed assets loading performance in 3.2.13.
+
+ The PR #8756 uses Sprockets for resolving files that already exists on disk, for those files their extensions don't need to be rewritten. Fixes #9803.
+
+ *Fred Wu*
+
* Fixed `ActionController#action_missing` not being called.
Fixes #9799.
View
2  actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -163,7 +163,7 @@ def rewrite_extension(source, dir, ext)
source
elsif source_ext.blank?
"#{source}.#{ext}"
- elsif exact_match_present?(source)
+ elsif File.exists?(source) || exact_match_present?(source)
source
else
"#{source}.#{ext}"
View
9 actionpack/test/template/sprockets_helper_test.rb
@@ -277,6 +277,15 @@ def compute_host(source, request, options = {})
assert_nothing_raised { javascript_include_tag('foo.min') }
end
+ test "assets that exist on filesystem don't need to go through Sprockets" do
+ @config.assets.digest = false
+ @config.assets.debug = true
+
+ Rails.application.assets.expects(:resolve).never
+
+ asset_paths.asset_for(FIXTURES.join("sprockets/app/javascripts/foo.min.js").to_path, 'min')
+ end
+
test "stylesheet path through asset_path" do
assert_match %r{/assets/application-[0-9a-f]+.css}, asset_path(:application, :ext => "css")

No commit comments for this range

Something went wrong with that request. Please try again.