Skip to content

Commit 2296340

Browse files
committed
Merge pull request rails#7783 from guilleiguaran/namespace-assets-cache-store
Assets cache shouldn't be shared between different environments
2 parents a7f8872 + a4c358f commit 2296340

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

railties/lib/rails/application/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def initialize(*)
5757
@assets.debug = false
5858
@assets.compile = true
5959
@assets.digest = false
60-
@assets.cache_store = [ :file_store, "#{root}/tmp/cache/assets/" ]
60+
@assets.cache_store = [ :file_store, "#{root}/tmp/cache/assets/#{Rails.env}/" ]
6161
@assets.js_compressor = nil
6262
@assets.css_compressor = nil
6363
@assets.initialize_on_precompile = true

railties/lib/rails/tasks/tmp.rake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ namespace :tmp do
66
'tmp/cache',
77
'tmp/sockets',
88
'tmp/pids',
9-
'tmp/cache/assets' ]
9+
'tmp/cache/assets/development',
10+
'tmp/cache/assets/test',
11+
'tmp/cache/assets/production' ]
1012

1113
tmp_dirs.each { |d| directory d }
1214

railties/test/application/assets_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ def show_detailed_exceptions?() true end
323323

324324
clean_assets!
325325

326-
files = Dir["#{app_path}/public/assets/**/*", "#{app_path}/tmp/cache/assets/*"]
326+
files = Dir["#{app_path}/public/assets/**/*", "#{app_path}/tmp/cache/assets/development/*",
327+
"#{app_path}/tmp/cache/assets/test/*", "#{app_path}/tmp/cache/assets/production/*"]
327328
assert_equal 0, files.length, "Expected no assets, but found #{files.join(', ')}"
328329
end
329330

0 commit comments

Comments
 (0)