railties 5.2.4 → 6.0.2.1

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