Skip to content

Commit

Permalink
Merge pull request #30770 from y-yagi/do_not_create_credential_in_dum…
Browse files Browse the repository at this point in the history
…my_application

Do not create credentials in dummy application
  • Loading branch information
kaspth committed Nov 12, 2017
2 parents a34a0cc + d1eb0ef commit 99f4d6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions railties/lib/rails/generators/rails/app/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def config_when_updating
end

def master_key
return if options[:pretend]
return if options[:pretend] || options[:dummy_app]

require "rails/generators/rails/master_key/master_key_generator"

Expand All @@ -169,7 +169,7 @@ def master_key
end

def credentials
return if options[:pretend]
return if options[:pretend] || options[:dummy_app]

require "rails/generators/rails/credentials/credentials_generator"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def generate_test_dummy(force = false)
opts[:skip_listen] = true
opts[:skip_git] = true
opts[:skip_turbolinks] = true
opts[:dummy_app] = true

invoke Rails::Generators::AppGenerator,
[ File.expand_path(dummy_path, destination_root) ], opts
Expand Down
2 changes: 2 additions & 0 deletions railties/test/generators/plugin_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ def test_unnecessary_files_are_not_generated_in_dummy_application
assert_no_file "test/dummy/Gemfile"
assert_no_file "test/dummy/public/robots.txt"
assert_no_file "test/dummy/README.md"
assert_no_file "test/dummy/config/master.key"
assert_no_file "test/dummy/config/credentials.yml.enc"
assert_no_directory "test/dummy/lib/tasks"
assert_no_directory "test/dummy/test"
assert_no_directory "test/dummy/vendor"
Expand Down

0 comments on commit 99f4d6e

Please sign in to comment.