Always enable digest and compile in the Rake task #2768

merged 1 commit into from Aug 31, 2011


None yet
6 participants

guilleiguaran commented Aug 31, 2011

No description provided.

@josevalim josevalim added a commit that referenced this pull request Aug 31, 2011

@josevalim josevalim Merge pull request #2768 from guilleiguaran/fix-assets-rake-task
Always enable digest and compile in the Rake task

@josevalim josevalim merged commit d6a0078 into rails:3-1-stable Aug 31, 2011


josevalim commented Aug 31, 2011

Thanks man! Are those things being merged into master as well? :)


josh commented on 3f29342 Aug 31, 2011

I don't see why we need this. Sounds like people aren't running the precompile task with RAILS_ENV=production.


guilleiguaran replied Aug 31, 2011

config.assets.digest isn't necessary since is default to true for production env but config.assets.compile is false by default for production env and it's causing problem to some users that are using erb to get assets url inside css and js files. See #2765


spohlenz commented Aug 31, 2011

Since it is possible to have config.assets.digest set to false in production, assets:precompile should probably not hard-code it to true.

Instead the filename should be set based on the value of config.assets.digest. Something like:

filename = target.join(config.assets.digest ? asset.digest_path : logical_path)

Although the manifest needs to update too... I'll submit a pull request.

It would be nice if assets:precompile was covered by the test suite so we could avoid regressions in the future.

tarikjn commented Sep 2, 2011

@betelgeuse I second that. I may have uncovered a related issue that is still on the 3-1-stable branch: #2805 (comment)


spohlenz commented Sep 2, 2011

@betelgeuse, @tarikjn: The assets:precompile rake task does have some tests but they're in railties/test/application/assets_test.rb rather than within ActionPack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment