1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Assets cache shouldn't be shared between different environments

This commit is contained in:
Guillermo Iguaran 2012-09-28 15:20:17 -05:00
parent 9eb72ac78f
commit a4c358f84c
3 changed files with 6 additions and 3 deletions

View file

@ -57,7 +57,7 @@ module Rails
@assets.debug = false @assets.debug = false
@assets.compile = true @assets.compile = true
@assets.digest = false @assets.digest = false
@assets.cache_store = [ :file_store, "#{root}/tmp/cache/assets/" ] @assets.cache_store = [ :file_store, "#{root}/tmp/cache/assets/#{Rails.env}/" ]
@assets.js_compressor = nil @assets.js_compressor = nil
@assets.css_compressor = nil @assets.css_compressor = nil
@assets.initialize_on_precompile = true @assets.initialize_on_precompile = true

View file

@ -6,7 +6,9 @@ namespace :tmp do
'tmp/cache', 'tmp/cache',
'tmp/sockets', 'tmp/sockets',
'tmp/pids', 'tmp/pids',
'tmp/cache/assets' ] 'tmp/cache/assets/development',
'tmp/cache/assets/test',
'tmp/cache/assets/production' ]
tmp_dirs.each { |d| directory d } tmp_dirs.each { |d| directory d }

View file

@ -323,7 +323,8 @@ module ApplicationTests
clean_assets! clean_assets!
files = Dir["#{app_path}/public/assets/**/*", "#{app_path}/tmp/cache/assets/*"] files = Dir["#{app_path}/public/assets/**/*", "#{app_path}/tmp/cache/assets/development/*",
"#{app_path}/tmp/cache/assets/test/*", "#{app_path}/tmp/cache/assets/production/*"]
assert_equal 0, files.length, "Expected no assets, but found #{files.join(', ')}" assert_equal 0, files.length, "Expected no assets, but found #{files.join(', ')}"
end end