Upgraded to Rails 3.1.rc6
EDIT: I confirm it’s fixed in 3.1.0-stable, and this patch is not compatible with the stable version.
This night I upgraded my main app of the moment to Rails 3.1.rc6. I followed this awesome post and everything went fine. I had to fix one or two tests, and now I have to think about what goes to the asset pipeline or not, but everything works fine!
One little gotcha with this version though, Sprockets outputs a lot (and I mean a LOT) of deprecation warnings because of this: https://github.com/rails/rails/issues/2598
The interesting part of this patch can easily be backported in an initializer until 3.1-stable is released. Let’s put it in
config/initializers/sprockets_warnings_silencer.rb
:
require 'sprockets/helpers/rails_helper' module Helpers module RailsHelper class AssetPaths def digest_for(logical_path) if asset = asset_environment[logical_path] return asset.digest_path end logical_path end def rewrite_asset_path(source, dir) if source[0] == ?/ source else source = digest_for(source) if performing_caching? source = File.join(dir, source) source = "/#{url}" unless source =~ /^\// source end end end end end
Now let’s explore all the awesome features of Rails 3.1 ! (and first split my bloated CSS and Javascript files)