railties 5.2.3 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +327 -125
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.rdoc +38 -31
  5. data/README.rdoc +2 -2
  6. data/lib/minitest/rails_plugin.rb +7 -11
  7. data/lib/rails.rb +5 -0
  8. data/lib/rails/all.rb +4 -0
  9. data/lib/rails/api/generator.rb +2 -1
  10. data/lib/rails/api/task.rb +17 -0
  11. data/lib/rails/app_loader.rb +2 -2
  12. data/lib/rails/app_updater.rb +3 -1
  13. data/lib/rails/application.rb +72 -30
  14. data/lib/rails/application/bootstrap.rb +2 -10
  15. data/lib/rails/application/configuration.rb +113 -13
  16. data/lib/rails/application/default_middleware_stack.rb +3 -0
  17. data/lib/rails/application/dummy_erb_compiler.rb +18 -0
  18. data/lib/rails/application/finisher.rb +54 -0
  19. data/lib/rails/autoloaders.rb +48 -0
  20. data/lib/rails/backtrace_cleaner.rb +5 -17
  21. data/lib/rails/code_statistics.rb +3 -3
  22. data/lib/rails/command.rb +11 -10
  23. data/lib/rails/command/base.rb +12 -4
  24. data/lib/rails/command/behavior.rb +7 -48
  25. data/lib/rails/command/environment_argument.rb +8 -15
  26. data/lib/rails/command/spellchecker.rb +58 -0
  27. data/lib/rails/commands/console/console_command.rb +6 -0
  28. data/lib/rails/commands/credentials/USAGE +19 -1
  29. data/lib/rails/commands/credentials/credentials_command.rb +52 -19
  30. data/lib/rails/commands/db/system/change/change_command.rb +20 -0
  31. data/lib/rails/commands/dbconsole/dbconsole_command.rb +20 -8
  32. data/lib/rails/commands/dev/dev_command.rb +19 -0
  33. data/lib/rails/commands/encrypted/USAGE +1 -1
  34. data/lib/rails/commands/encrypted/encrypted_command.rb +2 -2
  35. data/lib/rails/commands/help/help_command.rb +1 -1
  36. data/lib/rails/commands/initializers/initializers_command.rb +23 -0
  37. data/lib/rails/commands/new/new_command.rb +2 -2
  38. data/lib/rails/commands/notes/notes_command.rb +39 -0
  39. data/lib/rails/commands/plugin/plugin_command.rb +1 -1
  40. data/lib/rails/commands/routes/routes_command.rb +37 -0
  41. data/lib/rails/commands/runner/runner_command.rb +13 -9
  42. data/lib/rails/commands/secrets/USAGE +3 -3
  43. data/lib/rails/commands/secrets/secrets_command.rb +3 -3
  44. data/lib/rails/commands/server/server_command.rb +113 -50
  45. data/lib/rails/configuration.rb +1 -7
  46. data/lib/rails/engine.rb +32 -18
  47. data/lib/rails/engine/configuration.rb +5 -2
  48. data/lib/rails/gem_version.rb +3 -3
  49. data/lib/rails/generators.rb +11 -10
  50. data/lib/rails/generators/actions.rb +52 -39
  51. data/lib/rails/generators/app_base.rb +60 -98
  52. data/lib/rails/generators/app_name.rb +50 -0
  53. data/lib/rails/generators/database.rb +58 -0
  54. data/lib/rails/generators/erb/mailer/mailer_generator.rb +1 -1
  55. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +6 -3
  56. data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +1 -1
  57. data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +9 -1
  58. data/lib/rails/generators/generated_attribute.rb +53 -27
  59. data/lib/rails/generators/migration.rb +1 -2
  60. data/lib/rails/generators/model_helpers.rb +8 -1
  61. data/lib/rails/generators/named_base.rb +1 -5
  62. data/lib/rails/generators/rails/app/app_generator.rb +38 -71
  63. data/lib/rails/generators/rails/app/templates/Gemfile.tt +7 -10
  64. data/lib/rails/generators/rails/app/templates/app/assets/config/manifest.js.tt +0 -3
  65. data/lib/rails/generators/rails/app/templates/app/{assets/javascripts/cable.js.tt → javascript/channels/consumer.js} +2 -9
  66. data/lib/rails/generators/rails/app/templates/app/javascript/channels/index.js +5 -0
  67. data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +23 -0
  68. data/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt +5 -0
  69. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +4 -4
  70. data/lib/rails/generators/rails/app/templates/bin/setup.tt +7 -7
  71. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +2 -0
  72. data/lib/rails/generators/rails/app/templates/config/cable.yml.tt +1 -1
  73. data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt +2 -2
  74. data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt +2 -2
  75. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +2 -2
  76. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +3 -3
  77. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +3 -3
  78. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +1 -1
  79. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +4 -4
  80. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +2 -2
  81. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +6 -6
  82. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +1 -1
  83. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +2 -2
  84. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +5 -2
  85. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +28 -12
  86. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +13 -6
  87. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +1 -1
  88. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +7 -0
  89. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +45 -0
  90. data/lib/rails/generators/rails/app/templates/config/locales/en.yml +1 -1
  91. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +7 -3
  92. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +1 -1
  93. data/lib/rails/generators/rails/app/templates/config/spring.rb.tt +6 -6
  94. data/lib/rails/generators/rails/app/templates/gitignore.tt +3 -7
  95. data/lib/rails/generators/rails/app/templates/package.json.tt +7 -1
  96. data/lib/rails/generators/rails/app/templates/public/robots.txt +1 -1
  97. data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -1
  98. data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +11 -0
  99. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +7 -0
  100. data/lib/rails/generators/rails/assets/USAGE +1 -4
  101. data/lib/rails/generators/rails/assets/assets_generator.rb +0 -1
  102. data/lib/rails/generators/rails/controller/controller_generator.rb +11 -1
  103. data/lib/rails/generators/rails/credentials/credentials_generator.rb +7 -8
  104. data/lib/rails/generators/rails/db/system/change/change_generator.rb +65 -0
  105. data/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb +4 -5
  106. data/lib/rails/generators/rails/helper/helper_generator.rb +5 -0
  107. data/lib/rails/generators/rails/plugin/plugin_generator.rb +9 -33
  108. data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +1 -1
  109. data/lib/rails/generators/rails/plugin/templates/app/helpers/%namespaced_name%/application_helper.rb.tt +1 -1
  110. data/lib/rails/generators/rails/plugin/templates/app/jobs/%namespaced_name%/application_job.rb.tt +1 -1
  111. data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +1 -1
  112. data/lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt +1 -1
  113. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +2 -1
  114. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +1 -1
  115. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/railtie.rb.tt +1 -1
  116. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +1 -2
  117. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +14 -0
  118. data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +1 -1
  119. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +1 -1
  120. data/lib/rails/generators/resource_helpers.rb +1 -6
  121. data/lib/rails/generators/test_unit/integration/integration_generator.rb +6 -0
  122. data/lib/rails/generators/test_unit/job/job_generator.rb +5 -0
  123. data/lib/rails/generators/test_unit/mailer/mailer_generator.rb +1 -1
  124. data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +2 -2
  125. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +8 -3
  126. data/lib/rails/generators/test_unit/system/system_generator.rb +5 -0
  127. data/lib/rails/generators/testing/behaviour.rb +3 -0
  128. data/lib/rails/info.rb +3 -3
  129. data/lib/rails/info_controller.rb +1 -1
  130. data/lib/rails/mailers_controller.rb +7 -4
  131. data/lib/rails/paths.rb +19 -9
  132. data/lib/rails/railtie.rb +1 -1
  133. data/lib/rails/ruby_version_check.rb +3 -3
  134. data/lib/rails/secrets.rb +0 -1
  135. data/lib/rails/source_annotation_extractor.rb +138 -117
  136. data/lib/rails/tasks.rb +1 -0
  137. data/lib/rails/tasks/annotations.rake +9 -9
  138. data/lib/rails/tasks/dev.rake +5 -4
  139. data/lib/rails/tasks/framework.rake +5 -1
  140. data/lib/rails/tasks/initializers.rake +5 -4
  141. data/lib/rails/tasks/log.rake +0 -1
  142. data/lib/rails/tasks/routes.rake +4 -26
  143. data/lib/rails/tasks/statistics.rake +4 -0
  144. data/lib/rails/tasks/yarn.rake +1 -1
  145. data/lib/rails/tasks/zeitwerk.rake +66 -0
  146. data/lib/rails/templates/rails/welcome/index.html.erb +2 -2
  147. data/lib/rails/test_help.rb +11 -9
  148. data/lib/rails/test_unit/reporter.rb +1 -1
  149. data/lib/rails/test_unit/runner.rb +5 -5
  150. data/lib/rails/test_unit/testing.rake +1 -1
  151. metadata +35 -23
  152. data/lib/rails/generators/js/assets/assets_generator.rb +0 -15
  153. data/lib/rails/generators/js/assets/templates/javascript.js +0 -2
  154. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +0 -22
  155. data/lib/rails/generators/rails/app/templates/bin/bundle.tt +0 -2
  156. data/lib/rails/generators/rails/app/templates/bin/update.tt +0 -34
  157. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_2.rb.tt +0 -38
  158. data/lib/rails/generators/rails/assets/templates/javascript.js +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4a69a54be1b33b98f67a2a6932d9f2d540d4ca4d709e71b76a63a69bcd929c2
4
- data.tar.gz: 744e8d2b51e5a551e55b7dee2c24290c025ca1e878cc4e694e92d2a78ab06ffe
3
+ metadata.gz: 8978d3b263c42b7a7f85938aa1440c25f6796c9be7616280cf2c97930e088a70
4
+ data.tar.gz: 4f29426a081d75ad0716dfd4780280f62def9d25dcffa7b614b6c64e764cb9ad
5
5
  SHA512:
6
- metadata.gz: 52fc352ae01776093655bb8b91d7489613a4ca2d185dca1de781f60230f5a91355c96f193c22ec8c8b177482e097b35e867020c4a0138a7e5bba4457ffda1621
7
- data.tar.gz: 53259a4704e7f80beddce4c93db9ef66fc0702907afbe52574bbac98f3e7cea5d8e2eeab4ca434255732a79d6b46c281f7751294982521491485254fec0da24e
6
+ metadata.gz: 4da34a4d6f2bb8c0d3b0d0580a785a6b31fa591c3875b47dd9f8ceeb30a7c7f19a0ec282f511be8f2f9cbf0132ddd29e4b21f8562beeeec3519935d143ef9f0f
7
+ data.tar.gz: e96e83bf20181c578bc056b63a47397ea1db2d3075cbb9c1a88b79b4b19ce5e076dbc15a05fe9ec9e35b8f3724f075ce4cdb64df8ba7c037dd8524b5916bf938
@@ -1,249 +1,451 @@
1
- ## Rails 5.2.3 (March 27, 2019) ##
1
+ ## Rails 6.0.1 (November 5, 2019) ##
2
2
 
3
- * Seed database with inline ActiveJob job adapter.
3
+ * The `zeitwerk:check` Rake task reports files outside the app's root
4
+ directory, as in engines loaded from gems.
4
5
 
5
- *Gannon McGibbon*
6
+ *Xavier Noria*
6
7
 
7
- * Fix boolean interaction in scaffold system tests.
8
+ * Fixed a possible error when using the evented file update checker.
8
9
 
9
- *Gannon McGibbon*
10
+ *Yuji Yaginuma*
10
11
 
12
+ * The sqlite3 database files created by the parallel testing feature are
13
+ included in the default `.gitignore` file for newly-generated apps.
11
14
 
12
- ## Rails 5.2.2.1 (March 11, 2019) ##
15
+ *Yasuo Honda*
13
16
 
14
- * No changes.
17
+ * `rails new` generates a `.keep` file in `tmp/pids`. This fixes starting
18
+ a server via `rackup` instead of `rails server`.
15
19
 
20
+ *Rafael Mendonça França*
16
21
 
17
- ## Rails 5.2.2 (December 04, 2018) ##
18
22
 
19
- * Disable content security policy for mailer previews.
23
+ ## Rails 6.0.0 (August 16, 2019) ##
20
24
 
21
- *Dylan Reile*
25
+ * `Rails.autoloaders.log!` is a logging shortcut to get the activity of the
26
+ loaders printed to standard output. May be handy for troubleshooting.
22
27
 
23
- * Log the remote IP address of clients behind a proxy.
28
+ *Xavier Noria*
24
29
 
25
- *Atul Bhosale*
26
30
 
31
+ ## Rails 6.0.0.rc2 (July 22, 2019) ##
27
32
 
28
- ## Rails 5.2.1.1 (November 27, 2018) ##
33
+ * The new configuration point `config.add_autoload_paths_to_load_path` allows
34
+ users to opt-out from adding autoload paths to `$LOAD_PATH`. This flag is
35
+ `true` by default, but it is recommended to be set to `false` in `:zeitwerk`
36
+ mode early, in `config/application.rb`.
29
37
 
30
- * No changes.
38
+ Zeitwerk uses only absolute paths internally, and applications running in
39
+ `:zeitwerk` mode do not need `require_dependency`, so models, controllers,
40
+ jobs, etc. do not need to be in `$LOAD_PATH`. Setting this to `false` saves
41
+ Ruby from checking these directories when resolving `require` calls with
42
+ relative paths, and saves Bootsnap work and RAM, since it does not need to
43
+ build an index for them.
31
44
 
45
+ *Xavier Noria*
32
46
 
33
- ## Rails 5.2.1 (August 07, 2018) ##
47
+ ## Rails 6.0.0.rc1 (April 24, 2019) ##
34
48
 
35
- * Respect `NODE_ENV` when running `rails yarn:install`.
49
+ * Applications upgrading to Rails 6 can run the command
36
50
 
37
- *Max Melentiev*
51
+ ```
52
+ bin/rails zeitwerk:check
53
+ ```
38
54
 
39
- * Don't generate unused files in `app:update` task
55
+ to check if the project structure they were using with the classic
56
+ autoloader is compatible with `:zeitwerk` mode.
40
57
 
41
- Skip the assets' initializer when sprockets isn't loaded.
58
+ *Matilda Smeds* & *Xavier Noria*
42
59
 
43
- Skip `config/spring.rb` when spring isn't loaded.
60
+ * Allow loading seeds without ActiveJob.
44
61
 
45
- *Tsukuru Tanimichi*
62
+ Fixes #35782
46
63
 
47
- * Don't include `bootsnap` by default in apps generated under JRuby.
64
+ *Jeremy Weathers*
48
65
 
49
- Fixes #32641.
66
+ * `null: false` is set in the migrations by default for column pointed by
67
+ `belongs_to` / `references` association generated by model generator.
50
68
 
51
- *Guillermo Iguaran*
69
+ Also deprecate passing {required} to the model generator.
52
70
 
53
- * Create the `.ruby-version` file compatible with MRI/JRuby by default.
71
+ *Prathamesh Sonpatki*
54
72
 
55
- Fixes #32639.
73
+ * New applications get `config.cache_classes = false` in `config/environments/test.rb`
74
+ unless `--skip-spring`.
56
75
 
57
- *Guillermo Iguaran*
76
+ *Xavier Noria*
58
77
 
59
- * Make the master.key file read-only for the owner upon generation on
60
- POSIX-compliant systems.
78
+ * Autoloading during initialization is deprecated.
61
79
 
62
- Previously:
80
+ *Xavier Noria*
63
81
 
64
- $ ls -l config/master.key
65
- -rw-r--r-- 1 owner group 32 Jan 1 00:00 master.key
82
+ * Only force `:async` ActiveJob adapter to `:inline` during seeding.
66
83
 
67
- Now:
84
+ *BatedUrGonnaDie*
68
85
 
69
- $ ls -l config/master.key
70
- -rw------- 1 owner group 32 Jan 1 00:00 master.key
86
+ * The `connection` option of `rails dbconsole` command is deprecated in
87
+ favor of `database` option.
71
88
 
72
- Fixes #32604.
89
+ *Yuji Yaginuma*
73
90
 
74
- *Jose Luis Duran*
91
+ * Replace `chromedriver-helper` gem with `webdrivers` in default Gemfile.
92
+ `chromedriver-helper` is deprecated as of March 31, 2019 and won't
93
+ receive any further updates.
94
+
95
+ *Guillermo Iguaran‮*
96
+
97
+ * Applications running in `:zeitwerk` mode that use `bootsnap` need
98
+ to upgrade `bootsnap` to at least 1.4.2.
99
+
100
+ *Xavier Noria*
101
+
102
+ * Add `config.disable_sandbox` option to Rails console.
103
+
104
+ This setting will disable `rails console --sandbox` mode, preventing
105
+ developer from accidentally starting a sandbox console,
106
+ which when left inactive, can cause the database server to run out of memory.
75
107
 
76
- * Allow use of `minitest-rails` gem with Rails test runner.
108
+ *Prem Sichanugrist*
77
109
 
78
- Fixes #31324.
110
+ * Add `-e/--environment` option to `rails initializers`.
79
111
 
80
112
  *Yuji Yaginuma*
81
113
 
82
114
 
83
- ## Rails 5.2.0 (April 09, 2018) ##
115
+ ## Rails 6.0.0.beta3 (March 11, 2019) ##
84
116
 
85
- * Fix minitest rails plugin.
117
+ * Generate random development secrets
86
118
 
87
- The custom reporters are added only if needed.
119
+ A random development secret is now generated to tmp/development_secret.txt
88
120
 
89
- This will fix conflicts with others plugins.
121
+ This avoids an issue where development mode servers were vulnerable to
122
+ remote code execution.
90
123
 
91
- *Kevin Robatel*
124
+ Fixes CVE-2019-5420
92
125
 
93
- * Deprecate `after_bundle` callback in Rails plugin templates.
126
+ *Eileen M. Uchitelle*, *Aaron Patterson*, *John Hawthorn*
94
127
 
95
- *Yuji Yaginuma*
96
128
 
97
- * `rails new` and `rails plugin new` get `Active Storage` by default.
98
- Add ability to skip `Active Storage` with `--skip-active-storage`
99
- and do so automatically when `--skip-active-record` is used.
129
+ ## Rails 6.0.0.beta2 (February 25, 2019) ##
100
130
 
101
- *bogdanvlviv*
131
+ * Fix non-symbol access to nested hashes returned from `Rails::Application.config_for`
132
+ being broken by allowing non-symbol access with a deprecation notice.
102
133
 
103
- * Gemfile for new apps: upgrade redis-rb from ~> 3.0 to 4.0.
134
+ *Ufuk Kayserilioglu*
104
135
 
105
- *Jeremy Daer*
136
+ * Fix deeply nested namespace command printing.
106
137
 
107
- * Add `mini_magick` to default `Gemfile` as comment.
138
+ *Gannon McGibbon*
108
139
 
109
- *Yoshiyuki Hirano*
110
140
 
111
- * Derive `secret_key_base` from the app name in development and test environments.
141
+ ## Rails 6.0.0.beta1 (January 18, 2019) ##
112
142
 
113
- Spares away needless secret configs.
143
+ * Remove deprecated `after_bundle` helper inside plugins templates.
114
144
 
115
- *DHH*, *Kasper Timm Hansen*
145
+ *Rafael Mendonça França*
116
146
 
117
- * Support multiple versions arguments for `gem` method of Generators.
147
+ * Remove deprecated support to old `config.ru` that use the application class as argument of `run`.
118
148
 
119
- *Yoshiyuki Hirano*
149
+ *Rafael Mendonça França*
120
150
 
121
- * Add `--skip-yarn` option to the plugin generator.
151
+ * Remove deprecated `environment` argument from the rails commands.
122
152
 
123
- *bogdanvlviv*
153
+ *Rafael Mendonça França*
124
154
 
125
- * Optimize routes indentation.
155
+ * Remove deprecated `capify!`.
126
156
 
127
- *Yoshiyuki Hirano*
157
+ *Rafael Mendonça França*
128
158
 
129
- * Optimize indentation for generator actions.
159
+ * Remove deprecated `config.secret_token`.
130
160
 
131
- *Yoshiyuki Hirano*
161
+ *Rafael Mendonça França*
132
162
 
133
- * Skip unused components when running `bin/rails` in Rails plugin.
163
+ * Seed database with inline ActiveJob job adapter.
134
164
 
135
- *Yoshiyuki Hirano*
165
+ *Gannon McGibbon*
136
166
 
137
- * Add `git_source` to `Gemfile` for plugin generator.
167
+ * Add `rails db:system:change` command for changing databases.
138
168
 
139
- *Yoshiyuki Hirano*
169
+ ```
170
+ bin/rails db:system:change --to=postgresql
171
+ force config/database.yml
172
+ gsub Gemfile
173
+ ```
140
174
 
141
- * Add `--skip-action-cable` option to the plugin generator.
175
+ The change command copies a template `config/database.yml` with
176
+ the target database adapter into your app, and replaces your database gem
177
+ with the target database gem.
178
+
179
+ *Gannon McGibbon*
180
+
181
+ * Add `rails test:channels`.
142
182
 
143
183
  *bogdanvlviv*
144
184
 
145
- * Deprecate support for using a `Rails::Application` subclass to start Rails server.
185
+ * Use original `bundler` environment variables during the process of generating a new rails project.
146
186
 
147
- *Yuji Yaginuma*
187
+ *Marco Costa*
148
188
 
149
- * Add `ruby x.x.x` version to `Gemfile` and create `.ruby-version`
150
- root file containing the current Ruby version when new Rails applications are
151
- created.
189
+ * Send Active Storage analysis and purge jobs to dedicated queues by default.
152
190
 
153
- *Alberto Almagro*
191
+ Analysis jobs now use the `:active_storage_analysis` queue, and purge jobs
192
+ now use the `:active_storage_purge` queue. This matches Action Mailbox,
193
+ which sends its jobs to dedicated queues by default.
154
194
 
155
- * Support `-` as a platform-agnostic way to run a script from stdin with
156
- `rails runner`
195
+ *George Claghorn*
157
196
 
158
- *Cody Cutrer*
197
+ * Add `rails test:mailboxes`.
159
198
 
160
- * Add `bootsnap` to default `Gemfile`.
199
+ *George Claghorn*
161
200
 
162
- *Burke Libbey*
201
+ * Introduce guard against DNS rebinding attacks.
163
202
 
164
- * Properly expand shortcuts for environment's name running the `console`
165
- and `dbconsole` commands.
203
+ The `ActionDispatch::HostAuthorization` is a new middleware that prevents
204
+ against DNS rebinding and other `Host` header attacks. It is included in
205
+ the development environment by default with the following configuration:
166
206
 
167
- *Robin Dupret*
207
+ Rails.application.config.hosts = [
208
+ IPAddr.new("0.0.0.0/0"), # All IPv4 addresses.
209
+ IPAddr.new("::/0"), # All IPv6 addresses.
210
+ "localhost" # The localhost reserved domain.
211
+ ]
168
212
 
169
- * Passing the environment's name as a regular argument to the
170
- `rails dbconsole` and `rails console` commands is deprecated.
171
- The `-e` option should be used instead.
213
+ In other environments `Rails.application.config.hosts` is empty and no
214
+ `Host` header checks will be done. If you want to guard against header
215
+ attacks on production, you have to manually permit the allowed hosts
216
+ with:
172
217
 
173
- Previously:
218
+ Rails.application.config.hosts << "product.com"
174
219
 
175
- $ bin/rails dbconsole production
220
+ The host of a request is checked against the `hosts` entries with the case
221
+ operator (`#===`), which lets `hosts` support entries of type `Regexp`,
222
+ `Proc` and `IPAddr` to name a few. Here is an example with a regexp.
176
223
 
177
- Now:
224
+ # Allow requests from subdomains like `www.product.com` and
225
+ # `beta1.product.com`.
226
+ Rails.application.config.hosts << /.*\.product\.com/
227
+
228
+ A special case is supported that allows you to permit all sub-domains:
178
229
 
179
- $ bin/rails dbconsole -e production
230
+ # Allow requests from subdomains like `www.product.com` and
231
+ # `beta1.product.com`.
232
+ Rails.application.config.hosts << ".product.com"
180
233
 
181
- *Robin Dupret*, *Kasper Timm Hansen*
234
+ *Genadi Samokovarov*
182
235
 
183
- * Allow passing a custom connection name to the `rails dbconsole`
184
- command when using a 3-level database configuration.
236
+ * Remove redundant suffixes on generated helpers.
185
237
 
186
- $ bin/rails dbconsole -c replica
238
+ *Gannon McGibbon*
187
239
 
188
- *Robin Dupret*, *Jeremy Daer*
240
+ * Remove redundant suffixes on generated integration tests.
189
241
 
190
- * Skip unused components when running `bin/rails app:update`.
242
+ *Gannon McGibbon*
191
243
 
192
- If the initial app generation skipped Action Cable, Active Record etc.,
193
- the update task honors those skips too.
244
+ * Fix boolean interaction in scaffold system tests.
194
245
 
195
- *Yuji Yaginuma*
246
+ *Gannon McGibbon*
196
247
 
197
- * Make Rails' test runner work better with minitest plugins.
248
+ * Remove redundant suffixes on generated system tests.
198
249
 
199
- By demoting the Rails test runner to just another minitest plugin —
200
- and thereby not eager loading it — we can co-exist much better with
201
- other minitest plugins such as pride and minitest-focus.
250
+ *Gannon McGibbon*
202
251
 
203
- *Kasper Timm Hansen*
252
+ * Add an `abort_on_failure` boolean option to the generator method that shell
253
+ out (`generate`, `rake`, `rails_command`) to abort the generator if the
254
+ command fails.
204
255
 
205
- * Load environment file in `dbconsole` command.
256
+ *David Rodríguez*
206
257
 
207
- Fixes #29717.
258
+ * Remove `app/assets` and `app/javascript` from `eager_load_paths` and `autoload_paths`.
208
259
 
209
- *Yuji Yaginuma*
260
+ *Gannon McGibbon*
210
261
 
211
- * Add `rails secrets:show` command.
262
+ * Use Ids instead of memory addresses when displaying references in scaffold views.
212
263
 
213
- *Yuji Yaginuma*
264
+ Fixes #29200.
214
265
 
215
- * Allow mounting the same engine several times in different locations.
266
+ *Rasesh Patel*
216
267
 
217
- Fixes #20204.
268
+ * Adds support for multiple databases to `rails db:migrate:status`.
269
+ Subtasks are also added to get the status of individual databases (eg. `rails db:migrate:status:animals`).
218
270
 
219
- *David Rodríguez*
271
+ *Gannon McGibbon*
272
+
273
+ * Use Webpacker by default to manage app-level JavaScript through the new app/javascript directory.
274
+ Sprockets is now solely in charge, by default, of compiling CSS and other static assets.
275
+ Action Cable channel generators will create ES6 stubs rather than use CoffeeScript.
276
+ Active Storage, Action Cable, Turbolinks, and Rails-UJS are loaded by a new application.js pack.
277
+ Generators no longer generate JavaScript stubs.
278
+
279
+ *DHH*, *Lachlan Sylvester*
280
+
281
+ * Add `database` (aliased as `db`) option to model generator to allow
282
+ setting the database. This is useful for applications that use
283
+ multiple databases and put migrations per database in their own directories.
284
+
285
+ ```
286
+ bin/rails g model Room capacity:integer --database=kingston
287
+ invoke active_record
288
+ create db/kingston_migrate/20180830151055_create_rooms.rb
289
+ ```
290
+
291
+ Because rails scaffolding uses the model generator, you can
292
+ also specify a database with the scaffold generator.
293
+
294
+ *Gannon McGibbon*
295
+
296
+ * Raise an error when "recyclable cache keys" are being used by a cache store
297
+ that does not explicitly support it. Custom cache keys that do support this feature
298
+ can bypass this error by implementing the `supports_cache_versioning?` method on their
299
+ class and returning a truthy value.
300
+
301
+ *Richard Schneeman*
302
+
303
+ * Support environment specific credentials overrides.
220
304
 
221
- * Clear screenshot files in `tmp:clear` task.
305
+ So any environment will look for `config/credentials/#{Rails.env}.yml.enc` and fall back
306
+ to `config/credentials.yml.enc`.
307
+
308
+ The encryption key can be in `ENV["RAILS_MASTER_KEY"]` or `config/credentials/production.key`.
309
+
310
+ Environment credentials overrides can be edited with `rails credentials:edit --environment production`.
311
+ If no override is set up for the passed environment, it will be created.
312
+
313
+ Additionally, the default lookup paths can be overwritten with these configs:
314
+
315
+ - `config.credentials.content_path`
316
+ - `config.credentials.key_path`
317
+
318
+ *Wojciech Wnętrzak*
319
+
320
+ * Make `ActiveSupport::Cache::NullStore` the default cache store in the test environment.
321
+
322
+ *Michael C. Nelson*
323
+
324
+ * Emit warning for unknown inflection rule when generating model.
325
+
326
+ *Yoshiyuki Kinjo*
327
+
328
+ * Add `database` (aliased as `db`) option to migration generator.
329
+
330
+ If you're using multiple databases and have a folder for each database
331
+ for migrations (ex db/migrate and db/new_db_migrate) you can now pass the
332
+ `--database` option to the generator to make sure the the migration
333
+ is inserted into the correct folder.
334
+
335
+ ```
336
+ rails g migration CreateHouses --database=kingston
337
+ invoke active_record
338
+ create db/kingston_migrate/20180830151055_create_houses.rb
339
+ ```
340
+
341
+ *Eileen M. Uchitelle*
342
+
343
+ * Deprecate `rake routes` in favor of `rails routes`.
222
344
 
223
345
  *Yuji Yaginuma*
224
346
 
225
- * Add `railtie.rb` to the plugin generator
347
+ * Deprecate `rake initializers` in favor of `rails initializers`.
348
+
349
+ *Annie-Claude Côté*
350
+
351
+ * Deprecate `rake dev:cache` in favor of `rails dev:cache`.
352
+
353
+ *Annie-Claude Côté*
354
+
355
+ * Deprecate `rails notes` subcommands in favor of passing an `annotations` argument to `rails notes`.
356
+
357
+ The following subcommands are replaced by passing `--annotations` or `-a` to `rails notes`:
358
+ - `rails notes:custom ANNOTATION=custom` is deprecated in favor of using `rails notes -a custom`.
359
+ - `rails notes:optimize` is deprecated in favor of using `rails notes -a OPTIMIZE`.
360
+ - `rails notes:todo` is deprecated in favor of using`rails notes -a TODO`.
361
+ - `rails notes:fixme` is deprecated in favor of using `rails notes -a FIXME`.
362
+
363
+ *Annie-Claude Côté*
364
+
365
+ * Deprecate `SOURCE_ANNOTATION_DIRECTORIES` environment variable used by `rails notes`
366
+ through `Rails::SourceAnnotationExtractor::Annotation` in favor of using `config.annotations.register_directories`.
367
+
368
+ *Annie-Claude Côté*
369
+
370
+ * Deprecate `rake notes` in favor of `rails notes`.
371
+
372
+ *Annie-Claude Côté*
373
+
374
+ * Don't generate unused files in `app:update` task.
375
+
376
+ Skip the assets' initializer when sprockets isn't loaded.
377
+
378
+ Skip `config/spring.rb` when spring isn't loaded.
379
+
380
+ Skip yarn's contents when yarn integration isn't used.
226
381
 
227
382
  *Tsukuru Tanimichi*
228
383
 
229
- * Deprecate `capify!` method in generators and templates.
384
+ * Make the master.key file read-only for the owner upon generation on
385
+ POSIX-compliant systems.
230
386
 
231
- *Yuji Yaginuma*
387
+ Previously:
388
+
389
+ $ ls -l config/master.key
390
+ -rw-r--r-- 1 owner group 32 Jan 1 00:00 master.key
391
+
392
+ Now:
393
+
394
+ $ ls -l config/master.key
395
+ -rw------- 1 owner group 32 Jan 1 00:00 master.key
396
+
397
+ Fixes #32604.
232
398
 
233
- * Allow irb options to be passed from `rails console` command.
399
+ *Jose Luis Duran*
400
+
401
+ * Deprecate support for using the `HOST` environment variable to specify the server IP.
234
402
 
235
- Fixes #28988.
403
+ The `BINDING` environment variable should be used instead.
404
+
405
+ Fixes #29516.
236
406
 
237
407
  *Yuji Yaginuma*
238
408
 
239
- * Added a shared section to `config/database.yml` that will be loaded for all environments.
409
+ * Deprecate passing Rack server name as a regular argument to `rails server`.
410
+
411
+ Previously:
412
+
413
+ $ bin/rails server thin
414
+
415
+ There wasn't an explicit option for the Rack server to use, now we have the
416
+ `--using` option with the `-u` short switch.
417
+
418
+ Now:
419
+
420
+ $ bin/rails server -u thin
421
+
422
+ This change also improves the error message if a missing or mistyped rack
423
+ server is given.
424
+
425
+ *Genadi Samokovarov*
426
+
427
+ * Add "rails routes --expanded" option to output routes in expanded mode like
428
+ "psql --expanded". Result looks like:
429
+
430
+ ```
431
+ $ rails routes --expanded
432
+ --[ Route 1 ]------------------------------------------------------------
433
+ Prefix | high_scores
434
+ Verb | GET
435
+ URI | /high_scores(.:format)
436
+ Controller#Action | high_scores#index
437
+ --[ Route 2 ]------------------------------------------------------------
438
+ Prefix | new_high_score
439
+ Verb | GET
440
+ URI | /high_scores/new(.:format)
441
+ Controller#Action | high_scores#new
442
+ ```
240
443
 
241
- *Pierre Schambacher*
444
+ *Benoit Tigeot*
242
445
 
243
- * Namespace error pages' CSS selectors to stop the styles from bleeding into other pages
244
- when using Turbolinks.
446
+ * Rails 6 requires Ruby 2.5.0 or newer.
245
447
 
246
- *Jan Krutisch*
448
+ *Jeremy Daer*, *Kasper Timm Hansen*
247
449
 
248
450
 
249
- Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/railties/CHANGELOG.md) for previous changes.
451
+ Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/railties/CHANGELOG.md) for previous changes.