aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2018-12-07 07:01:32 +0100
committerYuji Yaginuma <yuuji.yaginuma@gmail.com>2018-12-07 15:01:32 +0900
commitf173ec77fc35ce57e94398310308e868689366bb (patch)
tree6e638c281c1f0a6e5b95b11c1c4628aa26b450bc /guides/source
parentb86f65a816546ff8eea39d25b62c995c7efc21dc (diff)
downloadrails-f173ec77fc35ce57e94398310308e868689366bb.tar.gz
rails-f173ec77fc35ce57e94398310308e868689366bb.tar.bz2
rails-f173ec77fc35ce57e94398310308e868689366bb.zip
Abort early if generator command fails (#34420)
* No need to go through ruby * Abort early if a generator command fails * Reuse `rails_command` method * Bump thor minimum dependency to 0.20.3 * Add some minimal docs * Add a changelog entry * Restore original logging
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/rails_application_templates.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/guides/source/rails_application_templates.md b/guides/source/rails_application_templates.md
index bc68a555c5..982df26987 100644
--- a/guides/source/rails_application_templates.md
+++ b/guides/source/rails_application_templates.md
@@ -195,6 +195,12 @@ You can also run commands as a super-user:
rails_command "log:clear", sudo: true
```
+You can also run commands that should abort application generation if they fail:
+
+```ruby
+rails_command "db:migrate", abort_on_failure: true
+```
+
### route(routing_code)
Adds a routing entry to the `config/routes.rb` file. In the steps above, we generated a person scaffold and also removed `README.rdoc`. Now, to make `PeopleController#index` the default page for the application: