railties 7.0.8.7 → 7.1.5.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 (168) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +723 -215
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.md +99 -0
  5. data/README.rdoc +4 -4
  6. data/lib/minitest/rails_plugin.rb +63 -0
  7. data/lib/rails/api/task.rb +35 -4
  8. data/lib/rails/app_updater.rb +14 -2
  9. data/lib/rails/application/bootstrap.rb +23 -4
  10. data/lib/rails/application/configuration.rb +190 -69
  11. data/lib/rails/application/default_middleware_stack.rb +8 -2
  12. data/lib/rails/application/dummy_config.rb +19 -0
  13. data/lib/rails/application/finisher.rb +43 -33
  14. data/lib/rails/application.rb +141 -33
  15. data/lib/rails/backtrace_cleaner.rb +5 -3
  16. data/lib/rails/cli.rb +5 -2
  17. data/lib/rails/command/actions.rb +10 -12
  18. data/lib/rails/command/base.rb +55 -53
  19. data/lib/rails/command/environment_argument.rb +32 -16
  20. data/lib/rails/command/helpers/editor.rb +17 -12
  21. data/lib/rails/command.rb +84 -33
  22. data/lib/rails/commands/about/about_command.rb +14 -0
  23. data/lib/rails/commands/application/application_command.rb +2 -0
  24. data/lib/rails/commands/console/console_command.rb +14 -14
  25. data/lib/rails/commands/credentials/USAGE +53 -55
  26. data/lib/rails/commands/credentials/credentials_command/diffing.rb +5 -3
  27. data/lib/rails/commands/credentials/credentials_command.rb +64 -70
  28. data/lib/rails/commands/db/system/change/change_command.rb +2 -1
  29. data/lib/rails/commands/dbconsole/dbconsole_command.rb +25 -115
  30. data/lib/rails/commands/destroy/destroy_command.rb +3 -2
  31. data/lib/rails/commands/dev/dev_command.rb +1 -6
  32. data/lib/rails/commands/encrypted/USAGE +15 -20
  33. data/lib/rails/commands/encrypted/encrypted_command.rb +46 -35
  34. data/lib/rails/commands/gem_help/USAGE +16 -0
  35. data/lib/rails/commands/gem_help/gem_help_command.rb +13 -0
  36. data/lib/rails/commands/generate/generate_command.rb +2 -2
  37. data/lib/rails/commands/help/USAGE +13 -13
  38. data/lib/rails/commands/help/help_command.rb +21 -2
  39. data/lib/rails/commands/initializers/initializers_command.rb +1 -4
  40. data/lib/rails/commands/middleware/middleware_command.rb +17 -0
  41. data/lib/rails/commands/new/new_command.rb +2 -0
  42. data/lib/rails/commands/notes/notes_command.rb +2 -1
  43. data/lib/rails/commands/plugin/plugin_command.rb +2 -0
  44. data/lib/rails/commands/rake/rake_command.rb +25 -22
  45. data/lib/rails/commands/restart/restart_command.rb +14 -0
  46. data/lib/rails/commands/routes/routes_command.rb +13 -1
  47. data/lib/rails/commands/runner/USAGE +14 -12
  48. data/lib/rails/commands/runner/runner_command.rb +32 -20
  49. data/lib/rails/commands/secret/secret_command.rb +13 -0
  50. data/lib/rails/commands/secrets/USAGE +44 -49
  51. data/lib/rails/commands/secrets/secrets_command.rb +20 -38
  52. data/lib/rails/commands/server/server_command.rb +33 -32
  53. data/lib/rails/commands/test/USAGE +14 -0
  54. data/lib/rails/commands/test/test_command.rb +56 -14
  55. data/lib/rails/commands/unused_routes/unused_routes_command.rb +75 -0
  56. data/lib/rails/commands/version/version_command.rb +1 -0
  57. data/lib/rails/configuration.rb +5 -5
  58. data/lib/rails/console/app.rb +1 -4
  59. data/lib/rails/deprecator.rb +7 -0
  60. data/lib/rails/engine/configuration.rb +50 -6
  61. data/lib/rails/engine.rb +49 -21
  62. data/lib/rails/gem_version.rb +4 -4
  63. data/lib/rails/generators/actions.rb +6 -15
  64. data/lib/rails/generators/active_model.rb +28 -14
  65. data/lib/rails/generators/app_base.rb +355 -82
  66. data/lib/rails/generators/app_name.rb +3 -14
  67. data/lib/rails/generators/base.rb +17 -9
  68. data/lib/rails/generators/database.rb +40 -2
  69. data/lib/rails/generators/erb/mailer/templates/layout.html.erb.tt +1 -1
  70. data/lib/rails/generators/generated_attribute.rb +12 -0
  71. data/lib/rails/generators/migration.rb +4 -5
  72. data/lib/rails/generators/model_helpers.rb +2 -1
  73. data/lib/rails/generators/rails/app/USAGE +22 -6
  74. data/lib/rails/generators/rails/app/app_generator.rb +85 -64
  75. data/lib/rails/generators/rails/app/templates/Dockerfile.tt +103 -0
  76. data/lib/rails/generators/rails/app/templates/Gemfile.tt +9 -11
  77. data/lib/rails/generators/rails/app/templates/app/views/layouts/mailer.html.erb.tt +1 -1
  78. data/lib/rails/generators/rails/app/templates/bin/setup.tt +10 -1
  79. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +6 -17
  80. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +4 -4
  81. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +3 -3
  82. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +4 -6
  83. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +3 -3
  84. data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +59 -0
  85. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +12 -2
  86. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +32 -28
  87. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +13 -9
  88. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +2 -0
  89. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +2 -2
  90. data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +1 -1
  91. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +3 -3
  92. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.tt +280 -0
  93. data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +11 -9
  94. data/lib/rails/generators/rails/app/templates/config/locales/en.yml +11 -13
  95. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +21 -20
  96. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +5 -1
  97. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +6 -4
  98. data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +10 -0
  99. data/lib/rails/generators/rails/app/templates/dockerignore.tt +43 -0
  100. data/lib/rails/generators/rails/app/templates/gitignore.tt +4 -8
  101. data/lib/rails/generators/rails/app/templates/node-version.tt +1 -0
  102. data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +10 -8
  103. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +9 -7
  104. data/lib/rails/generators/rails/application_record/application_record_generator.rb +4 -0
  105. data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +2 -1
  106. data/lib/rails/generators/rails/controller/USAGE +12 -4
  107. data/lib/rails/generators/rails/controller/controller_generator.rb +5 -0
  108. data/lib/rails/generators/rails/controller/templates/controller.rb.tt +1 -1
  109. data/lib/rails/generators/rails/credentials/credentials_generator.rb +29 -24
  110. data/lib/rails/generators/rails/credentials/templates/credentials.yml.tt +8 -0
  111. data/lib/rails/generators/rails/db/system/change/change_generator.rb +30 -0
  112. data/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +1 -2
  113. data/lib/rails/generators/rails/migration/USAGE +21 -11
  114. data/lib/rails/generators/rails/model/model_generator.rb +4 -0
  115. data/lib/rails/generators/rails/plugin/USAGE +17 -6
  116. data/lib/rails/generators/rails/plugin/plugin_generator.rb +5 -15
  117. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +2 -2
  118. data/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt +1 -1
  119. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +1 -17
  120. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +0 -2
  121. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +4 -4
  122. data/lib/rails/generators/rails/resource/resource_generator.rb +6 -0
  123. data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +2 -1
  124. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +1 -1
  125. data/lib/rails/generators/test_case.rb +2 -2
  126. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +1 -1
  127. data/lib/rails/generators/testing/{behaviour.rb → behavior.rb} +4 -1
  128. data/lib/rails/generators.rb +6 -14
  129. data/lib/rails/health_controller.rb +55 -0
  130. data/lib/rails/info.rb +1 -1
  131. data/lib/rails/info_controller.rb +33 -11
  132. data/lib/rails/mailers_controller.rb +15 -5
  133. data/lib/rails/paths.rb +13 -10
  134. data/lib/rails/rack/logger.rb +15 -12
  135. data/lib/rails/rackup/server.rb +15 -0
  136. data/lib/rails/railtie/configuration.rb +14 -1
  137. data/lib/rails/railtie.rb +31 -31
  138. data/lib/rails/ruby_version_check.rb +2 -0
  139. data/lib/rails/source_annotation_extractor.rb +67 -18
  140. data/lib/rails/tasks/engine.rake +8 -8
  141. data/lib/rails/tasks/framework.rake +4 -10
  142. data/lib/rails/tasks/log.rake +1 -1
  143. data/lib/rails/tasks/misc.rake +3 -14
  144. data/lib/rails/tasks/statistics.rake +5 -4
  145. data/lib/rails/tasks/tmp.rake +5 -5
  146. data/lib/rails/tasks/zeitwerk.rake +15 -35
  147. data/lib/rails/tasks.rb +0 -2
  148. data/lib/rails/templates/rails/mailers/email.html.erb +32 -0
  149. data/lib/rails/templates/rails/mailers/index.html.erb +14 -7
  150. data/lib/rails/templates/rails/mailers/mailer.html.erb +11 -5
  151. data/lib/rails/templates/rails/welcome/index.html.erb +1 -0
  152. data/lib/rails/test_help.rb +9 -14
  153. data/lib/rails/test_unit/line_filtering.rb +1 -1
  154. data/lib/rails/test_unit/reporter.rb +6 -2
  155. data/lib/rails/test_unit/runner.rb +36 -18
  156. data/lib/rails/test_unit/test_parser.rb +88 -0
  157. data/lib/rails/test_unit/testing.rake +13 -33
  158. data/lib/rails/testing/maintain_test_schema.rb +16 -0
  159. data/lib/rails/version.rb +1 -1
  160. data/lib/rails/zeitwerk_checker.rb +15 -0
  161. data/lib/rails.rb +15 -15
  162. metadata +64 -27
  163. data/RDOC_MAIN.rdoc +0 -97
  164. data/lib/rails/application/dummy_erb_compiler.rb +0 -18
  165. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt +0 -143
  166. data/lib/rails/generators/rails/model/USAGE +0 -113
  167. data/lib/rails/tasks/middleware.rake +0 -9
  168. data/lib/rails/tasks/restart.rake +0 -9
data/CHANGELOG.md CHANGED
@@ -1,55 +1,221 @@
1
- ## Rails 7.0.8.7 (December 10, 2024) ##
1
+ ## Rails 7.1.5.1 (December 10, 2024) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 7.0.8.6 (October 23, 2024) ##
6
+ ## Rails 7.1.5 (October 30, 2024) ##
7
7
 
8
8
  * No changes.
9
9
 
10
10
 
11
- ## Rails 7.0.8.5 (October 15, 2024) ##
11
+ ## Rails 7.1.4.2 (October 23, 2024) ##
12
12
 
13
13
  * No changes.
14
14
 
15
15
 
16
- ## Rails 7.0.8.4 (June 04, 2024) ##
16
+ ## Rails 7.1.4.1 (October 15, 2024) ##
17
17
 
18
18
  * No changes.
19
19
 
20
20
 
21
- ## Rails 7.0.8.3 (May 17, 2024) ##
21
+ ## Rails 7.1.4 (August 22, 2024) ##
22
22
 
23
- * No changes.
23
+ * Preserve `--asset-pipeline propshaft` when running `app:update`.
24
+
25
+ *Zacharias Knudsen*
26
+
27
+ * Allow string keys for SQLCommenter.
28
+
29
+ *Ngan Pham*
30
+
31
+ * Fix derived foreign key to return correctly when association id is part of query constraints.
32
+
33
+ *Varun Sharma*
34
+
35
+ * Show warning for `secret_key_base` in development too.
36
+
37
+ *fatkodima*
38
+
39
+ * Fix sanitizer vendor configuration in 7.1 defaults.
40
+
41
+ In apps where `rails-html-sanitizer` was not eagerly loaded, the sanitizer default could end up
42
+ being Rails::HTML4::Sanitizer when it should be set to `Rails::HTML5::Sanitizer`.
43
+
44
+ *Mike Dalessio*, *Rafael Mendonça França*
24
45
 
46
+ * Revert the use of `Concurrent.physical_processor_count` in default Puma config
25
47
 
26
- ## Rails 7.0.8.2 (May 16, 2024) ##
48
+ While for many people this saves one config to set, for many others using
49
+ a shared hosting solution, this cause the default configuration to spawn
50
+ way more workers than reasonable.
51
+
52
+ There is unfortunately no reliable way to detect how many cores an application
53
+ can realistically use, and even then, assuming the application should use
54
+ all the machine resources is often wrong.
55
+
56
+ *Jean Boussier*
57
+
58
+
59
+ ## Rails 7.1.3.4 (June 04, 2024) ##
27
60
 
28
61
  * No changes.
29
62
 
30
63
 
31
- ## Rails 7.0.8.1 (February 21, 2024) ##
64
+ ## Rails 7.1.3.3 (May 16, 2024) ##
32
65
 
33
66
  * No changes.
34
67
 
35
68
 
36
- ## Rails 7.0.8 (September 09, 2023) ##
69
+ ## Rails 7.1.3.2 (February 21, 2024) ##
37
70
 
38
- * Omit `webdrivers` gem dependency from `Gemfile` template
71
+ * No changes.
39
72
 
40
- *Sean Doyle*
41
73
 
42
- ## Rails 7.0.7.2 (August 22, 2023) ##
74
+ ## Rails 7.1.3.1 (February 21, 2024) ##
43
75
 
44
76
  * No changes.
45
77
 
46
78
 
47
- ## Rails 7.0.7.1 (August 22, 2023) ##
79
+ ## Rails 7.1.3 (January 16, 2024) ##
80
+
81
+ * Make sure `config.after_routes_loaded` hook runs on boot.
82
+
83
+ *Rafael Mendonça França*
84
+
85
+ * Fix `config.log_level` not being respected when using a `BroadcastLogger`
86
+
87
+ *Édouard Chin*
88
+
89
+ * Fix isolated engines to take `ActiveRecord::Base.table_name_prefix` into consideration.
90
+ This will allow for engine defined models, such as inside Active Storage, to respect
91
+ Active Record table name prefix configuration.
92
+
93
+ *Chedli Bourguiba*
94
+
95
+ * The `bin/rails app:template` command will no longer add potentially unwanted
96
+ gem platforms via `bundle lock --add-platform=...` commands.
97
+
98
+ *Jonathan Hefner*
99
+
100
+
101
+ ## Rails 7.1.2 (November 10, 2023) ##
102
+
103
+ * Fix running `db:system:change` when app has no Dockerfile.
104
+
105
+ *Hartley McGuire*
106
+
107
+ * If you accessed `config.eager_load_paths` and friends, later changes to
108
+ `config.paths` were not reflected in the expected auto/eager load paths.
109
+ Now, they are.
110
+
111
+ This bug has been latent since Rails 3.
112
+
113
+ Fixes #49629.
114
+
115
+ *Xavier Noria*
116
+
117
+ ## Rails 7.1.1 (October 11, 2023) ##
118
+
119
+ * Ensures the Rails generated Dockerfile uses correct ruby version and matches Gemfile.
120
+
121
+ *Abhay Nikam*
122
+
123
+
124
+ ## Rails 7.1.0 (October 05, 2023) ##
48
125
 
49
126
  * No changes.
50
127
 
51
128
 
52
- ## Rails 7.0.7 (August 09, 2023) ##
129
+ ## Rails 7.1.0.rc2 (October 01, 2023) ##
130
+
131
+ * Always set the Rails logger to be an instance of `ActiveSupport::BroadcastLogger`.
132
+
133
+ *Edouard Chin*
134
+
135
+
136
+ ## Rails 7.1.0.rc1 (September 27, 2023) ##
137
+
138
+ * Require `concurrent-ruby` in `config/puma.rb` so that Puma can boot in
139
+ production when `WEB_CONCURRENCY` is not explicitly specified.
140
+
141
+ Fixes #49323.
142
+
143
+ *Matt Brictson*
144
+
145
+ * Raise error when generating attribute with dangerous name.
146
+
147
+ The following will now raise an error as `save` and `hash` are already
148
+ defined by Active Record.
149
+
150
+ ```bash
151
+ $ bin/rails generate model Post save
152
+ $ bin/rails generate model Post hash
153
+ ```
154
+
155
+ *Petrik de Heus*
156
+
157
+
158
+ ## Rails 7.1.0.beta1 (September 13, 2023) ##
159
+
160
+ * Add ability to show slow tests to the test runner
161
+
162
+ ```bash
163
+ $ bin/test --profile # additionally prints 10 (default) slowest tests
164
+ # or
165
+ $ bin/test --profile 20 # prints 20 slowest tests
166
+ ```
167
+
168
+ *fatkodima*
169
+
170
+ * `rails new --javascript` generator now supports Bun
171
+
172
+ ```bash
173
+ $ rails new my_new_app --javascript=bun
174
+ ```
175
+
176
+ *Jason Meller*
177
+
178
+ * bin/setup uses `bun` instead of `yarn` when generated an app with bun
179
+
180
+ Use `bun install` on `bin/setup` when using `bun`.
181
+
182
+ *Cadu Ribeiro*
183
+
184
+ * `config/application.rb` now includes
185
+
186
+ ```ruby
187
+ config.autoload_lib(ignore: %w(assets tasks))
188
+ ```
189
+
190
+ In practice, this means that new 7.1 applications autoload from `lib` out of the box.
191
+
192
+ *Xavier Noria*
193
+
194
+ * Add an option to start rails console in sandbox mode by default
195
+
196
+ `sandbox_by_default` option is added to start rails console in sandbox
197
+ mode by default. With this option turned on, `--no-sandbox` must be
198
+ specified to start rails in non-sandbox mode.
199
+
200
+ Note that this option is ignored when rails environment is development
201
+ or test.
202
+
203
+ *Shouichi Kamiya*
204
+
205
+ * Omit `webdrivers` gem dependency from `Gemfile` template
206
+
207
+ *Sean Doyle*
208
+
209
+ * Support filtering tests by line ranges
210
+
211
+ The new syntax allows you to filter tests by line ranges. For example, the
212
+ following command runs tests from line 10 to 20.
213
+
214
+ ```bash
215
+ $ rails test test/models/user_test.rb:10-20
216
+ ```
217
+
218
+ *Shouichi Kamiya*, *Seonggi Yang*, *oljfte*, *Ryohei UEDA*
53
219
 
54
220
  * Update default scaffold templates to set 303 (See Other) as status code
55
221
  on redirect for the update action for XHR requests other than GET or POST
@@ -58,386 +224,728 @@
58
224
 
59
225
  *Guillermo Iguaran*
60
226
 
227
+ * The new `config.autoload_lib_once` is similar to `config.autoload_lib`,
228
+ except that it adds `lib` to `config.autoload_once_paths` instead.
61
229
 
62
- ## Rails 7.0.6 (June 29, 2023) ##
63
- * Avoid escaping paths when editing credentials.
230
+ By calling `config.autoload_lib_once`, classes and modules in `lib` can be
231
+ autoloaded, even from application initializers, but won't be reloaded.
64
232
 
65
- *Jonathan Hefner*
233
+ Please, see further details in the [autoloading
234
+ guide](https://guides.rubyonrails.org/v7.1/autoloading_and_reloading_constants.html).
66
235
 
236
+ *Xavier Noria*
67
237
 
68
- ## Rails 7.0.5.1 (June 26, 2023) ##
238
+ * Add `config.action_dispatch.debug_exception_log_level` to configure the log
239
+ level used by `ActionDispatch::DebugExceptions`.
69
240
 
70
- * No changes.
241
+ The default is `:fatal`, but with `load_defaults "7.1"` the default will be
242
+ `:error`.
71
243
 
244
+ *Hartley McGuire*
72
245
 
73
- ## Rails 7.0.5 (May 24, 2023) ##
246
+ * Add `DATABASE` option to `railties:install:migrations`
74
247
 
75
- * Add puma app server to Gemfile in order to start test/dummy.
248
+ This allows you to specify which database the migrations should be copied to
249
+ when running `rails railties:install:migrations`.
76
250
 
77
- *Donapieppo*
251
+ ```bash
252
+ $ rails railties:install:migrations DATABASE=animals
253
+ ```
78
254
 
79
- * Rails console now disables `IRB`'s autocompletion feature in production by default.
255
+ *Matthew Hirst*
80
256
 
81
- Setting `IRB_USE_AUTOCOMPLETE=true` can override this default.
257
+ * The new method `config.autoload_lib(ignore:)` provides a simple way to
258
+ autoload from `lib`:
82
259
 
83
- *Stan Lo*
260
+ ```ruby
261
+ # config/application.rb
262
+ config.autoload_lib(ignore: %w(assets tasks))
263
+ ```
84
264
 
85
- * Send 303 See Other status code back for the destroy action on newly generated
86
- scaffold controllers.
265
+ Please, see further details in the [autoloading
266
+ guide](https://guides.rubyonrails.org/v7.1/autoloading_and_reloading_constants.html).
87
267
 
88
- *Tony Drake*
268
+ *Xavier Noria*
89
269
 
270
+ * Don't show secret_key_base for `Rails.application.config#inspect`.
90
271
 
91
- ## Rails 7.0.4.3 (March 13, 2023) ##
272
+ Before:
92
273
 
93
- * No changes.
274
+ ```ruby
275
+ Rails.application.config.inspect
276
+ "#<Rails::Application::Configuration:0x00000001132b02a0 @root=... @secret_key_base=\"b3c631c314c0bbca50c1b2843150fe33\" ... >"
277
+ ```
94
278
 
279
+ After:
95
280
 
96
- ## Rails 7.0.4.2 (January 24, 2023) ##
281
+ ```ruby
282
+ Rails.application.config.inspect
283
+ "#<Rails::Application::Configuration:0x00000001132b02a0>"
284
+ ```
97
285
 
98
- * No changes.
286
+ *Petrik de Heus*
99
287
 
288
+ * Deprecate calling `Rails.application.secrets`.
100
289
 
101
- ## Rails 7.0.4.1 (January 17, 2023) ##
290
+ Rails `secrets` have been deprecated in favor of `credentials`.
291
+ Calling `Rails.application.secrets` should show a deprecation warning.
102
292
 
103
- * No changes.
293
+ *Petrik de Heus*
104
294
 
295
+ * Store `secret_key_base` in `Rails.config` for local environments.
105
296
 
106
- ## Rails 7.0.4 (September 09, 2022) ##
297
+ Rails `secrets` have been deprecated in favor of `credentials`.
298
+ For the local environments the `secret_key_base` is now stored in
299
+ `Rails.config.secret_key_base` instead of the soft deprecated
300
+ `Rails.application.secrets.secret_key_base`.
107
301
 
108
- * `config.allow_concurrency = false` now use a `Monitor` instead of a `Mutex`
302
+ *Petrik de Heus*
109
303
 
110
- This allows to enable `config.active_support.executor_around_test_case` even
111
- when `config.allow_concurrency` is disabled.
304
+ * Enable force_ssl=true in production by default: Force all access to the app over SSL,
305
+ use Strict-Transport-Security, and use secure cookies
112
306
 
113
- *Jean Boussier*
307
+ *Justin Searls*, *Aaron Patterson*, *Guillermo Iguaran*, *Vinícius Bispo*
114
308
 
115
- * Skip Active Storage and Action Mailer if Active Job is skipped.
309
+ * Add engine's draw paths to application route set, so that the application
310
+ can draw route files defined in engine paths.
116
311
 
117
- *Étienne Barrié*
312
+ *Gannon McGibbon*
118
313
 
119
- * Correctly check if frameworks are disabled when running app:update.
314
+ * Support `VISUAL` environment variable for commands which open an editor,
315
+ and prefer it over `EDITOR`.
120
316
 
121
- *Étienne Barrié* and *Paulo Barros*
317
+ *Summer ☀️*
122
318
 
123
- * Fixed `config.active_support.cache_format_version` never being applied.
319
+ * Add engine's `test/fixtures` path to `fixture_paths` in `on_load` hook if
320
+ path exists and is under the Rails application root.
124
321
 
125
- Rails 7.0 shipped with a new serializer for Rails.cache, but the associated config
126
- wasn't working properly. Note that even after this fix, it can only be applied from
127
- the `application.rb` file.
322
+ *Chris Salzberg*
128
323
 
129
- *Alex Ghiculescu*
324
+ * `bin/rails app:template` now runs `bundle install` and any `after_bundle`
325
+ blocks after the template is executed.
130
326
 
327
+ *Jonathan Hefner* and *Gerry Caulfield*
131
328
 
132
- ## Rails 7.0.3.1 (July 12, 2022) ##
329
+ * Enable passing column size to migration generator
133
330
 
134
- * No changes.
331
+ Previously you could pass a limit to the migration generator:
135
332
 
333
+ `rails generate migration CreateAuthor name:text{65535}`
136
334
 
137
- ## Rails 7.0.3 (May 09, 2022) ##
335
+ Now, a size attribute can be passed to the migration generator:
138
336
 
139
- * If reloading and eager loading are both enabled, after a reload Rails eager loads again the application code.
337
+ `rails generate migration CreateAuthor name:text{medium}`
140
338
 
141
- *Xavier Noria*
339
+ This generates a migration which includes the size attribute:
142
340
 
143
- * Use `controller_class_path` in `Rails::Generators::NamedBase#route_url`
341
+ ```ruby
342
+ class CreateAuthor < ActiveRecord::Migration[7.1]
343
+ def change
344
+ create_table :authors do |t|
345
+ t.text :name, size: :medium
346
+ end
347
+ end
348
+ end
349
+ ```
144
350
 
145
- The `route_url` method now returns the correct path when generating
146
- a namespaced controller with a top-level model using `--model-name`.
351
+ *Josh Broughton*, *Hartley McGuire*
147
352
 
148
- Previously, when running this command:
353
+ * Trying to set a config key with the same name of a method now raises:
149
354
 
150
- ``` sh
151
- bin/rails generate scaffold_controller Admin/Post --model-name Post
355
+ ```ruby
356
+ config.load_defaults = 7.0
357
+ # NoMethodError: Cannot assign to `load_defaults`, it is a configuration method
152
358
  ```
153
359
 
154
- the comments above the controller action would look like:
360
+ *Xavier Noria*
155
361
 
156
- ``` ruby
157
- # GET /posts
158
- def index
159
- @posts = Post.all
160
- end
161
- ```
362
+ * Deprecate `secrets:edit/show` and remove `secrets:setup`
162
363
 
163
- afterwards, they now look like this:
364
+ `bin/rails secrets:setup` has been deprecated since Rails 5.2 in favor of
365
+ credentials. This command has been removed.
164
366
 
165
- ``` ruby
166
- # GET /admin/posts
167
- def index
168
- @posts = Post.all
169
- end
367
+ `bin/rails secrets:show` and `bin/rails secrets:edit` have been deprecated
368
+ in favor of credentials.
369
+
370
+ Run `bin/rails credentials:help` for more information
371
+
372
+ *Petrik de Heus*
373
+
374
+ * `bin/rails --help` will now list only framework and plugin commands. Rake
375
+ tasks defined in `lib/tasks/*.rake` files will no longer be included. For a
376
+ list of those tasks, use `rake -T`.
377
+
378
+ *Jonathan Hefner*
379
+
380
+ * Allow calling `bin/rails restart` outside of app directory.
381
+
382
+ The following would previously fail with a "No Rakefile found" error.
383
+
384
+ ```bash
385
+ $ blog/bin/rails restart
170
386
  ```
171
387
 
172
- Fixes #44662.
388
+ *Petrik de Heus*
173
389
 
174
- *Andrew White*
390
+ * Support prerelease rubies in Gemfile template if RubyGems version is 3.3.13 or higher.
175
391
 
176
- ## Rails 7.0.2.4 (April 26, 2022) ##
392
+ *Yasuo Honda*, *David Rodríguez*
177
393
 
178
- * No changes.
394
+ * Autoloading setup honors root directories manually set by the user.
179
395
 
396
+ This is relevant for custom namespaces. For example, if you'd like classes
397
+ and modules under `app/services` to be defined in the `Services` namespace
398
+ without an extra `app/services/services` directory, this is now enough:
180
399
 
181
- ## Rails 7.0.2.3 (March 08, 2022) ##
400
+ ```ruby
401
+ # config/initializers/autoloading.rb
182
402
 
183
- * No changes.
403
+ # The namespace has to exist.
404
+ #
405
+ # In this example we define the module on the spot. Could also be created
406
+ # elsewhere and its definition loaded here with an ordinary `require`. In
407
+ # any case, `push_dir` expects a class or module object.
408
+ module Services; end
184
409
 
410
+ Rails.autoloaders.main.push_dir("#{Rails.root}/app/services", namespace: Services)
411
+ ```
185
412
 
186
- ## Rails 7.0.2.2 (February 11, 2022) ##
413
+ Check the autoloading guide for further details.
187
414
 
188
- * No changes.
415
+ *Xavier Noria*
189
416
 
417
+ * Railties now requires the irb gem as a dependency, which means when you install Rails, irb will also
418
+ be installed as a gem. Rails will then use the installed version of irb for its console instead of
419
+ relying on Ruby's built-in version.
420
+ This ensures that Rails has access to the most up-to-date and reliable version of irb for its console.
190
421
 
191
- ## Rails 7.0.2.1 (February 11, 2022) ##
422
+ *Stan Lo*
192
423
 
193
- * No changes.
424
+ * Use infinitive form for all rails command descriptions verbs.
194
425
 
426
+ *Petrik de Heus*
195
427
 
196
- ## Rails 7.0.2 (February 08, 2022) ##
428
+ * Credentials commands (e.g. `bin/rails credentials:edit`) now respect
429
+ `config.credentials.content_path` and `config.credentials.key_path` when set
430
+ in `config/application.rb` or `config/environments/#{Rails.env}.rb`.
197
431
 
198
- * No changes.
432
+ Before:
199
433
 
434
+ * `bin/rails credentials:edit` ignored `RAILS_ENV`, and would always edit
435
+ `config/credentials.yml.enc`.
200
436
 
201
- ## Rails 7.0.1 (January 06, 2022) ##
437
+ * `bin/rails credentials:edit --environment foo` would create and edit
438
+ `config/credentials/foo.yml.enc`.
202
439
 
203
- * Prevent duplicate entries in plugin Gemfile.
440
+ * If `config.credentials.content_path` or `config.credentials.key_path`
441
+ was set, `bin/rails credentials:edit` could not be used to edit the
442
+ credentials. Editing credentials required using `bin/rails
443
+ encrypted:edit path/to/credentials --key path/to/key`.
204
444
 
205
- *Jonathan Hefner*
445
+ After:
206
446
 
207
- * Fix asset pipeline errors for plugin dummy apps.
447
+ * `bin/rails credentials:edit` will edit the credentials file that the app
448
+ would load for the current `RAILS_ENV`.
208
449
 
209
- *Jonathan Hefner*
450
+ * `bin/rails credentials:edit` respects `config.credentials.content_path`
451
+ and `config.credentials.key_path` when set in `config/application.rb`
452
+ or `config/environments/#{Rails.env}.rb`.
210
453
 
211
- * Fix generated route revocation.
454
+ * `bin/rails credentials:edit --environment foo` will create and edit
455
+ `config/credentials/foo.yml.enc` _if_ `config.credentials.content_path`
456
+ has not been set for the `foo` environment. Ultimately, it will edit
457
+ the credentials file that the app would load for the `foo` environment.
212
458
 
213
459
  *Jonathan Hefner*
214
460
 
215
- * Addresses an issue in which Sidekiq jobs could not reload certain
216
- namespaces.
461
+ * Add descriptions for non-Rake commands when running `rails -h`.
217
462
 
218
- See [fxn/zeitwerk#198](https://github.com/fxn/zeitwerk/issues/198) for
219
- details.
463
+ *Petrik de Heus*
220
464
 
221
- *Xavier Noria*
465
+ * Show relevant commands when calling help
222
466
 
223
- * Fix plugin generator to a plugin that pass all the tests.
467
+ When running `rails -h` or just `rails` outside a Rails application,
468
+ Rails outputs all options for running the `rails new` command. This can be
469
+ confusing to users when they probably want to see the common Rails commands.
224
470
 
225
- *Rafael Mendonça França*
471
+ Instead, we should always show the common commands when running `rails -h`
472
+ inside or outside a Rails application.
226
473
 
474
+ As the relevant commands inside a Rails application differ from the
475
+ commands outside an application, the help USAGE file has been split to
476
+ show the most relevant commands for the context.
227
477
 
228
- ## Rails 7.0.0 (December 15, 2021) ##
478
+ *Petrik de Heus*
229
479
 
230
- * No changes.
480
+ * Add Rails::HealthController#show and map it to /up for newly generated applications.
481
+ Load balancers and uptime monitors all need a basic endpoint to tell whether the app is up.
482
+ This is a good starting point that'll work in many situations.
231
483
 
484
+ *DHH*
232
485
 
233
- ## Rails 7.0.0.rc3 (December 14, 2021) ##
486
+ * Only use HostAuthorization middleware if `config.hosts` is not empty
234
487
 
235
- * Allow localhost with a port by default in development
488
+ *Hartley McGuire*
236
489
 
237
- [Fixes: #43864]
490
+ * Raise an exception when a `before_action`'s "only" or "except" filter
491
+ options reference an action that doesn't exist. This will be enabled by
492
+ default but can be overridden via config.
238
493
 
239
- ## Rails 7.0.0.rc2 (December 14, 2021) ##
494
+ ```ruby
495
+ # config/environments/production.rb
496
+ config.action_controller.raise_on_missing_callback_actions = false
497
+ ```
240
498
 
241
- * No changes
499
+ *Jess Bees*
242
500
 
243
- ## Rails 7.0.0.rc1 (December 06, 2021) ##
501
+ * Use physical processor count as the default Puma worker count in production.
502
+ This can be overridden by setting `ENV["WEB_CONCURRENCY"]` or editing the
503
+ generated "config/puma.rb" directly.
244
504
 
245
- * Remove deprecated `config` in `dbconsole`.
505
+ *DHH*
246
506
 
247
- *Rafael Mendonça França*
507
+ * Add Docker files by default to new apps: Dockerfile, .dockerignore, bin/docker-entrypoint.
508
+ These files can be skipped with `--skip-docker`. They're intended as a starting point for
509
+ a production deploy of the application. Not intended for development (see Docked Rails for that).
248
510
 
249
- * Change default `X-XSS-Protection` header to disable XSS auditor
511
+ Example:
250
512
 
251
- This header has been deprecated and the XSS auditor it triggered
252
- has been removed from all major modern browsers (in favour of
253
- Content Security Policy) that implemented this header to begin with
254
- (Firefox never did).
513
+ ```bash
514
+ $ docker build -t app .
515
+ $ docker volume create app-storage
516
+ $ docker run --rm -it -v app-storage:/rails/storage -p 3000:3000 --env RAILS_MASTER_KEY=<see config/master.key> app
517
+ ```
255
518
 
256
- [OWASP](https://owasp.org/www-project-secure-headers/#x-xss-protection)
257
- suggests setting this header to '0' to disable the default behaviour
258
- on old browsers as it can introduce additional security issues.
519
+ You can also start a console or a runner from this image:
259
520
 
260
- Added the new behaviour as a framework default from Rails 7.0.
521
+ ```bash
522
+ $ docker run --rm -it -v app-storage:/rails/storage --env RAILS_MASTER_KEY=<see config/master.key> app console
523
+ ```
261
524
 
262
- *Christian Sutter*
525
+ To create a multi-platform image on Apple Silicon to deploy on AMD or Intel and push to Docker Hub for user/app:
263
526
 
264
- * Scaffolds now use date_field, time_field and datetime_field instead of
265
- date_select, time_select and datetime_select; thus providing native date/time pickers.
527
+ ```bash
528
+ $ docker login -u <user>
529
+ $ docker buildx create --use
530
+ $ docker buildx build --push --platform=linux/amd64,linux/arm64 -t <user/image> .
531
+ ```
266
532
 
267
- *Martijn Lafeber*
533
+ *DHH, Sam Ruby*
268
534
 
269
- * Fix a regression in which autoload paths were initialized too late.
535
+ * Add ENV["SECRET_KEY_BASE_DUMMY"] for starting production environment with a generated secret base key,
536
+ which can be used to run tasks like `assets:precompile` without making the RAILS_MASTER_KEY available
537
+ to the build process.
270
538
 
271
- *Xavier Noria*
539
+ Dockerfile layer example:
272
540
 
273
- ## Rails 7.0.0.alpha2 (September 15, 2021) ##
541
+ ```
542
+ RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile
543
+ ```
274
544
 
275
- * Fix activestorage dependency in the npm package.
545
+ *DHH*
276
546
 
277
- *Rafael Mendonça França*
547
+ * Show descriptions for all commands in Rails help
278
548
 
279
- ## Rails 7.0.0.alpha1 (September 15, 2021) ##
549
+ When calling `rails help` most commands missed their description. We now
550
+ show the same descriptions as shown in `rails -T`.
280
551
 
281
- * New and upgraded Rails apps no longer generate `config/initializers/application_controller_renderer.rb`
282
- or `config/initializers/cookies_serializer.rb`
552
+ *Petrik de Heus*
283
553
 
284
- The default value for `cookies_serializer` (`:json`) has been moved to `config.load_defaults("7.0")`.
285
- The new framework defaults file can be used to upgrade the serializer.
554
+ * Always generate the storage/ directory with rails new to ensure there's a stable place to
555
+ put permanent files, and a single mount point for containers to map. Then default sqlite3 databases
556
+ to live there instead of db/, which is only meant for configuration, not data.
286
557
 
287
- *Alex Ghiculescu*
558
+ *DHH*
288
559
 
289
- * New applications get a dependency on the new `debug` gem, replacing `byebug`.
560
+ * Rails console now disables `IRB`'s autocompletion feature in production by default.
290
561
 
291
- *Xavier Noria*
562
+ Setting `IRB_USE_AUTOCOMPLETE=true` can override this default.
292
563
 
293
- * Add SSL support for postgresql in `bin/rails dbconsole`.
564
+ *Stan Lo*
294
565
 
295
- Fixes #43114.
566
+ * Add `config.precompile_filter_parameters`, which enables precompilation of
567
+ `config.filter_parameters` using `ActiveSupport::ParameterFilter.precompile_filters`.
568
+ Precompilation can improve filtering performance, depending on the quantity
569
+ and types of filters.
296
570
 
297
- *Michael Bayucot*
571
+ `config.precompile_filter_parameters` defaults to `true` for
572
+ `config.load_defaults 7.1` and above.
298
573
 
299
- * Add support for comments above gem declaration in Rails application templates, e.g. `gem("nokogiri", comment: "For XML")`.
574
+ *Jonathan Hefner*
300
575
 
301
- *Linas Juškevičius*
576
+ * Add `after_routes_loaded` hook to `Rails::Railtie::Configuration` for
577
+ engines to add a hook to be called after application routes have been
578
+ loaded.
302
579
 
303
- * The setter `config.autoloader=` has been deleted. `zeitwerk` is the only
304
- available autoloading mode.
580
+ ```ruby
581
+ MyEngine.config.after_routes_loaded do
582
+ # code that must happen after routes have been loaded
583
+ end
584
+ ```
305
585
 
306
- *Xavier Noria*
586
+ *Chris Salzberg*
307
587
 
308
- * `config.autoload_once_paths` can be configured in the body of the
309
- application class defined in `config/application.rb` or in the configuration
310
- for environments in `config/environments/*`.
588
+ * Send 303 See Other status code back for the destroy action on newly generated
589
+ scaffold controllers.
311
590
 
312
- Similarly, engines can configure that collection in the class body of the
313
- engine class or in the configuration for environments.
591
+ *Tony Drake*
314
592
 
315
- After that, the collection is frozen, and you can autoload from those paths.
316
- They are managed by the `Rails.autoloaders.once` autoloader, which does not
317
- reload, only autoloads/eager loads.
593
+ * Add `Rails.application.deprecators` as a central point to manage deprecators
594
+ for an application.
318
595
 
319
- *Xavier Noria*
596
+ Individual deprecators can be added and retrieved from the collection:
320
597
 
321
- * During initialization, you cannot autoload reloadable classes or modules
322
- like application models, unless they are wrapped in a `to_prepare` block.
323
- For example, from `config/initializers/*`, or in application, engines, or
324
- railties initializers.
598
+ ```ruby
599
+ Rails.application.deprecators[:my_gem] = ActiveSupport::Deprecation.new("2.0", "MyGem")
600
+ Rails.application.deprecators[:other_gem] = ActiveSupport::Deprecation.new("3.0", "OtherGem")
601
+ ```
325
602
 
326
- Please check the [autoloading
327
- guide](https://guides.rubyonrails.org/v7.0/autoloading_and_reloading_constants.html#autoloading-when-the-application-boots)
328
- for details.
603
+ And the collection's configuration methods affect all deprecators in the
604
+ collection:
329
605
 
330
- *Xavier Noria*
606
+ ```ruby
607
+ Rails.application.deprecators.debug = true
331
608
 
332
- * While they are allowed to have elements in common, it is no longer required
333
- that `config.autoload_once_paths` is a subset of `config.autoload_paths`.
334
- The former are managed by the `once` autoloader. The `main` autoloader
335
- manages the latter minus the former.
609
+ Rails.application.deprecators[:my_gem].debug
610
+ # => true
611
+ Rails.application.deprecators[:other_gem].debug
612
+ # => true
613
+ ```
336
614
 
337
- *Xavier Noria*
615
+ Additionally, all deprecators in the collection can be silenced for the
616
+ duration of a given block:
338
617
 
339
- * Show Rake task description if command is run with `-h`.
618
+ ```ruby
619
+ Rails.application.deprecators.silence do
620
+ Rails.application.deprecators[:my_gem].warn # => silenced (no warning)
621
+ Rails.application.deprecators[:other_gem].warn # => silenced (no warning)
622
+ end
623
+ ```
340
624
 
341
- Adding `-h` (or `--help`) to a Rails command that's a Rake task now outputs
342
- the task description instead of the general Rake help.
625
+ *Jonathan Hefner*
343
626
 
344
- *Petrik de Heus*
627
+ * Move dbconsole logic to Active Record connection adapter.
345
628
 
346
- * Add missing `plugin new` command to help.
629
+ Instead of hosting the connection logic in the command object, the
630
+ database adapter should be responsible for connecting to a console session.
631
+ This patch moves #find_cmd_and_exec to the adapter and exposes a new API to
632
+ lookup the adapter class without instantiating it.
347
633
 
348
- *Petrik de Heus
634
+ *Gannon McGibbon*, *Paarth Madan*
349
635
 
350
- * Fix `config_for` error when there's only a shared root array.
636
+ * Add `Rails.application.message_verifiers` as a central point to configure
637
+ and create message verifiers for an application.
351
638
 
352
- *Loïc Delmaire*
639
+ This allows applications to, for example, rotate old `secret_key_base`
640
+ values:
353
641
 
354
- * Raise an error in generators if an index type is invalid.
642
+ ```ruby
643
+ config.before_initialize do |app|
644
+ app.message_verifiers.rotate(secret_key_base: "old secret_key_base")
645
+ end
646
+ ```
647
+
648
+ And for libraries to create preconfigured message verifiers:
649
+
650
+ ```ruby
651
+ ActiveStorage.verifier = Rails.application.message_verifiers["ActiveStorage"]
652
+ ```
653
+
654
+ *Jonathan Hefner*
655
+
656
+ * Support MySQL's ssl-mode option for the dbconsole command.
657
+
658
+ Verifying the identity of the database server requires setting the ssl-mode
659
+ option to VERIFY_CA or VERIFY_IDENTITY. This option was previously ignored
660
+ for the dbconsole command.
355
661
 
356
662
  *Petrik de Heus*
357
663
 
358
- * `package.json` now uses a strict version constraint for Rails JavaScript packages on new Rails apps.
664
+ * Delegate application record generator description to orm hooked generator.
359
665
 
360
- *Zachary Scott*, *Alex Ghiculescu*
666
+ *Gannon McGibbon*
361
667
 
362
- * Modified scaffold generator template so that running
363
- `rails g scaffold Author` no longer generates tests called "creating
364
- a Author", "updating a Author", and "destroying a Author".
668
+ * Show BCC recipients when present in Action Mailer previews.
365
669
 
366
- Fixes #40744.
670
+ *Akshay Birajdar*
367
671
 
368
- *Michael Duchemin*
672
+ * Extend `routes --grep` to also filter routes by matching against path.
369
673
 
370
- * Raise an error in generators if a field type is invalid.
674
+ Example:
371
675
 
372
- *Petrik de Heus*
676
+ ```bash
677
+ $ bin/rails routes --grep /cats/1
678
+ Prefix Verb URI Pattern Controller#Action
679
+ cat GET /cats/:id(.:format) cats#show
680
+ PATCH /cats/:id(.:format) cats#update
681
+ PUT /cats/:id(.:format) cats#update
682
+ DELETE /cats/:id(.:format) cats#destroy
683
+ ```
684
+
685
+ *Orhan Toy*
373
686
 
374
- * `bin/rails tmp:clear` deletes also files and directories in `tmp/storage`.
687
+ * Improve `rails runner` output when given a file path that doesn't exist.
375
688
 
376
- *George Claghorn*
689
+ *Tekin Suleyman*
377
690
 
378
- * Fix compatibility with `psych >= 4`.
691
+ * `config.allow_concurrency = false` now use a `Monitor` instead of a `Mutex`
379
692
 
380
- Starting in Psych 4.0.0 `YAML.load` behaves like `YAML.safe_load`. To preserve compatibility
381
- `Rails.application.config_for` now uses `YAML.unsafe_load` if available.
693
+ This allows to enable `config.active_support.executor_around_test_case` even
694
+ when `config.allow_concurrency` is disabled.
382
695
 
383
696
  *Jean Boussier*
384
697
 
385
- * Allow loading nested locales in engines.
698
+ * Add `routes --unused` option to detect extraneous routes.
699
+
700
+ Example:
701
+
702
+ ```bash
703
+ $ bin/rails routes --unused
704
+
705
+ Found 2 unused routes:
706
+
707
+ Prefix Verb URI Pattern Controller#Action
708
+ one GET /one(.:format) action#one
709
+ two GET /two(.:format) action#two
710
+ ```
711
+
712
+ *Gannon McGibbon*
713
+
714
+ * Add `--parent` option to controller generator to specify parent class of job.
715
+
716
+ Example:
717
+
718
+ `bin/rails g controller admin/users --parent=admin_controller` generates:
719
+
720
+ ```ruby
721
+ class Admin::UsersController < AdminController
722
+ # ...
723
+ end
724
+ ```
386
725
 
387
726
  *Gannon McGibbon*
388
727
 
389
- * Ensure `Rails.application.config_for` always cast hashes to `ActiveSupport::OrderedOptions`.
728
+ * In-app custom credentials templates are now supported. When a credentials
729
+ file does not exist, `rails credentials:edit` will now try to use
730
+ `lib/templates/rails/credentials/credentials.yml.tt` to generate the
731
+ credentials file, before falling back to the default template.
390
732
 
391
- *Jean Boussier*
733
+ This allows e.g. an open-source Rails app (which would not include encrypted
734
+ credentials files in its repo) to include a credentials template, so that
735
+ users who install the app will get a custom pre-filled credentials file when
736
+ they run `rails credentials:edit`.
737
+
738
+ *Jonathan Hefner*
392
739
 
393
- * Remove `Rack::Runtime` from the default middleware stack and deprecate
394
- referencing it in middleware operations without adding it back.
740
+ * Except for `dev` and `test` environments, newly generated per-environment
741
+ credentials files (e.g. `config/credentials/production.yml.enc`) now include
742
+ a `secret_key_base` for convenience, just as `config/credentials.yml.enc`
743
+ does.
395
744
 
396
- *Hartley McGuire*
745
+ *Jonathan Hefner*
746
+
747
+ * `--no-*` options now work with the app generator's `--minimal` option, and
748
+ are both comprehensive and precise. For example:
749
+
750
+ ```bash
751
+ $ rails new my_cool_app --minimal
752
+ Based on the specified options, the following options will also be activated:
753
+
754
+ --skip-active-job [due to --minimal]
755
+ --skip-action-mailer [due to --skip-active-job, --minimal]
756
+ --skip-active-storage [due to --skip-active-job, --minimal]
757
+ --skip-action-mailbox [due to --skip-active-storage, --minimal]
758
+ --skip-action-text [due to --skip-active-storage, --minimal]
759
+ --skip-javascript [due to --minimal]
760
+ --skip-hotwire [due to --skip-javascript, --minimal]
761
+ --skip-action-cable [due to --minimal]
762
+ --skip-bootsnap [due to --minimal]
763
+ --skip-dev-gems [due to --minimal]
764
+ --skip-system-test [due to --minimal]
765
+
766
+ ...
767
+
768
+ $ rails new my_cool_app --minimal --no-skip-active-storage
769
+ Based on the specified options, the following options will also be activated:
770
+
771
+ --skip-action-mailer [due to --minimal]
772
+ --skip-action-mailbox [due to --minimal]
773
+ --skip-action-text [due to --minimal]
774
+ --skip-javascript [due to --minimal]
775
+ --skip-hotwire [due to --skip-javascript, --minimal]
776
+ --skip-action-cable [due to --minimal]
777
+ --skip-bootsnap [due to --minimal]
778
+ --skip-dev-gems [due to --minimal]
779
+ --skip-system-test [due to --minimal]
780
+
781
+ ...
782
+ ```
397
783
 
398
- * Allow adding additional authorized hosts in development via `ENV['RAILS_DEVELOPMENT_HOSTS']`.
784
+ *Brad Trick* and *Jonathan Hefner*
399
785
 
400
- *Josh Abernathy*, *Debbie Milburn*
786
+ * Add `--skip-dev-gems` option to app generator to skip adding development
787
+ gems (like `web-console`) to the Gemfile.
401
788
 
402
- * Add app concern and test keepfiles to generated engine plugins.
789
+ *Brad Trick*
790
+
791
+ * Skip Active Storage and Action Mailer if Active Job is skipped.
792
+
793
+ *Étienne Barrié*
794
+
795
+ * Correctly check if frameworks are disabled when running app:update.
796
+
797
+ *Étienne Barrié* and *Paulo Barros*
798
+
799
+ * Delegate model generator description to orm hooked generator.
403
800
 
404
801
  *Gannon McGibbon*
405
802
 
406
- * Stop generating a license for in-app plugins.
803
+ * Execute `rails runner` scripts inside the executor.
804
+
805
+ Enables error reporting, query cache, etc.
806
+
807
+ *Jean Boussier*
808
+
809
+ * Avoid booting in development then test for test tasks.
810
+
811
+ Running one of the rails test subtasks (e.g. test:system, test:models) would
812
+ go through Rake and cause the app to be booted twice. Now all the test:*
813
+ subtasks are defined as Thor tasks and directly load the test environment.
814
+
815
+ *Étienne Barrié*
816
+
817
+ * Deprecate `Rails::Generators::Testing::Behaviour` in favor of `Rails::Generators::Testing::Behavior`.
407
818
 
408
819
  *Gannon McGibbon*
409
820
 
410
- * `rails app:update` no longer prompts you to overwrite files that are generally modified in the
411
- course of developing a Rails app. See [#41083](https://github.com/rails/rails/pull/41083) for
412
- the full list of changes.
821
+ * Allow configuration of logger size for local and test environments
413
822
 
414
- *Alex Ghiculescu*
823
+ `config.log_file_size`
415
824
 
416
- * Change default branch for new Rails projects and plugins to `main`.
825
+ Defaults to `100` megabytes.
417
826
 
418
- *Prateek Choudhary*
827
+ *Bernie Chiu*
419
828
 
420
- * The new method `Rails.benchmark` gives you a quick way to measure and log the execution time taken by a block:
829
+ * Enroll new apps in decrypted diffs of credentials by default. This behavior
830
+ can be opted out of with the app generator's `--skip-decrypted-diffs` flag.
421
831
 
422
- def test_expensive_stuff
423
- Rails.benchmark("test_expensive_stuff") { ... }
424
- end
832
+ *Jonathan Hefner*
425
833
 
426
- This functionality was available in some contexts only before.
834
+ * Support declarative-style test name filters with `bin/rails test`.
427
835
 
428
- *Simon Perepelitsa*
836
+ This makes it possible to run a declarative-style test such as:
429
837
 
430
- * Applications generated with `--skip-sprockets` no longer get `app/assets/config/manifest.js` and `app/assets/stylesheets/application.css`.
838
+ ```ruby
839
+ class MyTest < ActiveSupport::TestCase
840
+ test "does something" do
841
+ # ...
842
+ end
843
+ end
844
+ ```
431
845
 
432
- *Cindy Gao*
846
+ Using its declared name:
433
847
 
434
- * Add support for stylesheets and ERB views to `rails stats`.
848
+ ```bash
849
+ $ bin/rails test test/my_test.rb -n "does something"
850
+ ```
435
851
 
436
- *Joel Hawksley*
852
+ Instead of having to specify its expanded method name:
437
853
 
438
- * Allow appended root routes to take precedence over internal welcome controller.
854
+ ```bash
855
+ $ bin/rails test test/my_test.rb -n test_does_something
856
+ ```
439
857
 
440
- *Gannon McGibbon*
858
+ *Jonathan Hefner*
859
+
860
+ * Add `--js` and `--skip-javascript` options to `rails new`
861
+
862
+ `--js` alias to `rails new --javascript ...`
863
+
864
+ Same as `-j`, e.g. `rails new --js esbuild ...`
865
+
866
+ `--skip-js` alias to `rails new --skip-javascript ...`
867
+
868
+ Same as `-J`, e.g. `rails new --skip-js ...`
869
+
870
+ *Dorian Marié*
871
+
872
+ * Allow relative paths with leading dot slash to be passed to `rails test`.
873
+
874
+ Fix `rails test ./test/model/post_test.rb` to run a single test file.
875
+
876
+ *Shouichi Kamiya* and *oljfte*
877
+
878
+ * Deprecate `config.enable_dependency_loading`. This flag addressed a limitation of the `classic` autoloader and has no effect nowadays. To fix this deprecation, please just delete the reference.
879
+
880
+ *Xavier Noria*
881
+
882
+ * Define `config.enable_reloading` to be `!config.cache_classes` for a more intuitive name. While `config.enable_reloading` and `config.reloading_enabled?` are preferred from now on, `config.cache_classes` is supported for backwards compatibility.
883
+
884
+ *Xavier Noria*
885
+
886
+ * Add JavaScript dependencies installation on bin/setup
887
+
888
+ Add `yarn install` to bin/setup when using esbuild, webpack, or rollout.
889
+
890
+ *Carlos Ribeiro*
891
+
892
+ * Use `controller_class_path` in `Rails::Generators::NamedBase#route_url`
893
+
894
+ The `route_url` method now returns the correct path when generating
895
+ a namespaced controller with a top-level model using `--model-name`.
896
+
897
+ Previously, when running this command:
898
+
899
+ ```bash
900
+ $ bin/rails generate scaffold_controller Admin/Post --model-name Post
901
+ ```
902
+
903
+ the comments above the controller action would look like:
904
+
905
+ ``` ruby
906
+ # GET /posts
907
+ def index
908
+ @posts = Post.all
909
+ end
910
+ ```
911
+
912
+ afterwards, they now look like this:
913
+
914
+ ``` ruby
915
+ # GET /admin/posts
916
+ def index
917
+ @posts = Post.all
918
+ end
919
+ ```
920
+
921
+ Fixes #44662.
922
+
923
+ *Andrew White*
924
+
925
+ * No longer add autoloaded paths to `$LOAD_PATH`.
926
+
927
+ This means it won't be possible to load them with a manual `require` call, the class or module can be referenced instead.
928
+
929
+ Reducing the size of `$LOAD_PATH` speed-up `require` calls for apps not using `bootsnap`, and reduce the
930
+ size of the `bootsnap` cache for the others.
931
+
932
+ *Jean Boussier*
933
+
934
+ * Remove default `X-Download-Options` header
935
+
936
+ This header is currently only used by Internet Explorer which
937
+ will be discontinued in 2022 and since Rails 7 does not fully
938
+ support Internet Explorer this header should not be a default one.
939
+
940
+ *Harun Sabljaković*
941
+
942
+ * Add .node-version files for Rails apps that use Node.js
943
+
944
+ Node version managers that make use of this file:
945
+ https://github.com/shadowspawn/node-version-usage#node-version-file-usage
946
+
947
+ The generated Dockerfile will use the same node version.
441
948
 
949
+ *Sam Ruby*
442
950
 
443
- Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/railties/CHANGELOG.md) for previous changes.
951
+ Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/railties/CHANGELOG.md) for previous changes.