Skip to content

Commit

Permalink
Merge pull request rails#35607 from y-yagi/ensure_application_work_wi…
Browse files Browse the repository at this point in the history
…thout_tmp_directory

Make application work without tmp directory
  • Loading branch information
y-yagi committed Mar 14, 2019
1 parent 4e649d1 commit b4079b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions railties/lib/rails/application.rb
Expand Up @@ -594,6 +594,7 @@ def generate_development_secret

if !File.exist?(key_file)
random_key = SecureRandom.hex(64)
FileUtils.mkdir_p(key_file.dirname)
File.binwrite(key_file, random_key)
end

Expand Down
3 changes: 3 additions & 0 deletions railties/test/application/configuration_test.rb
Expand Up @@ -518,6 +518,9 @@ def index
Rails.application.credentials.secret_key_base = nil
RUBY

# For test that works even if tmp dir does not exist.
Dir.chdir(app_path) { FileUtils.remove_dir("tmp") }

app "development"

assert_not_nil app.secrets.secret_key_base
Expand Down

0 comments on commit b4079b1

Please sign in to comment.