From 90c720a8b4daf60950beb4a7821deb87e3174b0c Mon Sep 17 00:00:00 2001 From: Petrik Date: Fri, 20 Dec 2019 10:59:25 +0100 Subject: [PATCH] Don't use rails command shortcuts in guides [ci skip] Use the full rails commands instead of the shortcuts in the guides. This makes things clearer for new users. --- guides/source/active_record_migrations.md | 2 +- guides/source/active_record_multiple_databases.md | 2 +- .../autoloading_and_reloading_constants_classic_mode.md | 4 ++-- guides/source/engines.md | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/guides/source/active_record_migrations.md b/guides/source/active_record_migrations.md index 49bcdab960..d5006525c8 100644 --- a/guides/source/active_record_migrations.md +++ b/guides/source/active_record_migrations.md @@ -258,7 +258,7 @@ For more `add_reference` options, visit the [API documentation](https://api.ruby There is also a generator which will produce join tables if `JoinTable` is part of the name: ```bash -$ rails g migration CreateJoinTableCustomerProduct customer product +$ rails generate migration CreateJoinTableCustomerProduct customer product ``` will produce the following migration: diff --git a/guides/source/active_record_multiple_databases.md b/guides/source/active_record_multiple_databases.md index 58b237c1c2..15d0354583 100644 --- a/guides/source/active_record_multiple_databases.md +++ b/guides/source/active_record_multiple_databases.md @@ -167,7 +167,7 @@ For example the `animals` database would look in the `db/animals_migrate` direct so that the file is generated in the correct directory. The command can be run like so: ```bash -$ rails g migration CreateDogs name:string --database animals +$ rails generate migration CreateDogs name:string --database animals ``` ## Activating automatic connection switching diff --git a/guides/source/autoloading_and_reloading_constants_classic_mode.md b/guides/source/autoloading_and_reloading_constants_classic_mode.md index 9f869f7ac2..2783d28e22 100644 --- a/guides/source/autoloading_and_reloading_constants_classic_mode.md +++ b/guides/source/autoloading_and_reloading_constants_classic_mode.md @@ -486,7 +486,7 @@ The value of `autoload_paths` can be inspected. In a just-generated application it is (edited): ```bash -$ rails r 'puts ActiveSupport::Dependencies.autoload_paths' +$ rails runner 'puts ActiveSupport::Dependencies.autoload_paths' .../app/assets .../app/channels .../app/controllers @@ -1226,7 +1226,7 @@ been loaded but `app/models/hotel/image.rb` hasn't, Ruby does not find `Image` in `Hotel`, but it does in `Object`: ```bash -$ rails r 'Image; p Hotel::Image' 2>/dev/null +$ rails runner 'Image; p Hotel::Image' 2>/dev/null Image # NOT Hotel::Image! ``` diff --git a/guides/source/engines.md b/guides/source/engines.md index 7d7a069032..1dc939f2d9 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -202,7 +202,7 @@ within the `Engine` class definition. Without it, classes generated in an engine **may** conflict with an application. What this isolation of the namespace means is that a model generated by a call -to `rails g model`, such as `rails g model article`, won't be called `Article`, but +to `rails generate model`, such as `rails generate model article`, won't be called `Article`, but instead be namespaced and called `Blorgh::Article`. In addition, the table for the model is namespaced, becoming `blorgh_articles`, rather than simply `articles`. Similar to the model namespacing, a controller called `ArticlesController` becomes @@ -845,7 +845,7 @@ of associating the records in the `blorgh_articles` table with the records in th To generate this new column, run this command within the engine: ```bash -$ rails g migration add_author_id_to_blorgh_articles author_id:integer +$ rails generate migration add_author_id_to_blorgh_articles author_id:integer ``` NOTE: Due to the migration's name and the column specification after it, Rails