diff --git a/guides/source/active_record_migrations.md b/guides/source/active_record_migrations.md index 49bcdab9601cd72326eb070c150863f5039aa27c..d5006525c836f2e7e34a6b9b58bac387387842ec 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 58b237c1c2f2d1a61eff0334472189b20406c25c..15d035458323365c577844a0e05ae4356e395cd3 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 9f869f7ac2ae85c9c83f61a43884a910827f3c1e..2783d28e2267f4c42d01d8d46390b752c48c07ad 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 7d7a06903288363485b5eb38f92f9a8af1b555b8..1dc939f2d966181b673afd92582ecd1fc5e65d7d 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