railties 7.1.5.2 → 7.2.0

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 (130) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +177 -805
  3. data/lib/minitest/rails_plugin.rb +5 -2
  4. data/lib/rails/all.rb +1 -3
  5. data/lib/rails/api/task.rb +6 -4
  6. data/lib/rails/application/bootstrap.rb +5 -6
  7. data/lib/rails/application/configuration.rb +68 -33
  8. data/lib/rails/application/dummy_config.rb +2 -2
  9. data/lib/rails/application/finisher.rb +7 -0
  10. data/lib/rails/application.rb +15 -89
  11. data/lib/rails/backtrace_cleaner.rb +14 -1
  12. data/lib/rails/cli.rb +0 -1
  13. data/lib/rails/command.rb +1 -1
  14. data/lib/rails/commands/app/update_command.rb +93 -0
  15. data/lib/rails/commands/boot/boot_command.rb +14 -0
  16. data/lib/rails/commands/console/console_command.rb +2 -21
  17. data/lib/rails/commands/console/irb_console.rb +137 -0
  18. data/lib/rails/commands/credentials/credentials_command.rb +2 -2
  19. data/lib/rails/commands/dbconsole/dbconsole_command.rb +21 -30
  20. data/lib/rails/commands/devcontainer/devcontainer_command.rb +39 -0
  21. data/lib/rails/commands/rake/rake_command.rb +1 -1
  22. data/lib/rails/commands/runner/runner_command.rb +14 -3
  23. data/lib/rails/commands/server/server_command.rb +5 -3
  24. data/lib/rails/commands/test/test_command.rb +2 -0
  25. data/lib/rails/configuration.rb +10 -1
  26. data/lib/rails/console/app.rb +5 -32
  27. data/lib/rails/console/helpers.rb +5 -16
  28. data/lib/rails/console/methods.rb +23 -0
  29. data/lib/rails/engine.rb +5 -5
  30. data/lib/rails/gem_version.rb +3 -3
  31. data/lib/rails/generators/app_base.rb +70 -49
  32. data/lib/rails/generators/base.rb +5 -1
  33. data/lib/rails/generators/database.rb +227 -69
  34. data/lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt +2 -0
  35. data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +2 -0
  36. data/lib/rails/generators/erb/scaffold/templates/new.html.erb.tt +2 -0
  37. data/lib/rails/generators/generated_attribute.rb +26 -1
  38. data/lib/rails/generators/rails/app/app_generator.rb +53 -24
  39. data/lib/rails/generators/rails/app/templates/Dockerfile.tt +22 -15
  40. data/lib/rails/generators/rails/app/templates/Gemfile.tt +16 -16
  41. data/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt +4 -0
  42. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +8 -1
  43. data/lib/rails/generators/rails/app/templates/app/views/pwa/manifest.json.erb.tt +22 -0
  44. data/lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js +26 -0
  45. data/lib/rails/generators/rails/app/templates/bin/brakeman.tt +6 -0
  46. data/lib/rails/generators/rails/app/templates/bin/rubocop.tt +7 -0
  47. data/lib/rails/generators/rails/app/templates/bin/setup.tt +6 -2
  48. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +1 -1
  49. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +3 -3
  50. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +7 -0
  51. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +8 -1
  52. data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +3 -3
  53. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +14 -7
  54. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +5 -0
  55. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +8 -5
  56. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +1 -1
  57. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt +70 -0
  58. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +24 -35
  59. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +4 -0
  60. data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +5 -0
  61. data/lib/rails/generators/rails/app/templates/dockerignore.tt +13 -0
  62. data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +138 -0
  63. data/lib/rails/generators/rails/app/templates/github/dependabot.yml +12 -0
  64. data/lib/rails/generators/rails/app/templates/gitignore.tt +3 -3
  65. data/lib/rails/generators/rails/app/templates/public/406-unsupported-browser.html +66 -0
  66. data/lib/rails/generators/rails/app/templates/public/icon.png +0 -0
  67. data/lib/rails/generators/rails/app/templates/public/icon.svg +3 -0
  68. data/lib/rails/generators/rails/app/templates/rubocop.yml.tt +8 -0
  69. data/lib/rails/generators/rails/app/templates/test/application_system_test_case.rb.tt +1 -1
  70. data/lib/rails/generators/rails/controller/controller_generator.rb +1 -1
  71. data/lib/rails/generators/rails/db/system/change/change_generator.rb +131 -20
  72. data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +166 -0
  73. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/Dockerfile.tt +3 -0
  74. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/compose.yaml.tt +47 -0
  75. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt +37 -0
  76. data/lib/rails/generators/rails/migration/migration_generator.rb +4 -0
  77. data/lib/rails/generators/rails/plugin/plugin_generator.rb +38 -7
  78. data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +2 -2
  79. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +5 -1
  80. data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +2 -0
  81. data/lib/rails/generators/rails/plugin/templates/bin/rubocop.tt +7 -0
  82. data/lib/rails/generators/rails/plugin/templates/github/ci.yml.tt +103 -0
  83. data/lib/rails/generators/rails/plugin/templates/github/dependabot.yml +12 -0
  84. data/lib/rails/generators/rails/plugin/templates/rubocop.yml.tt +8 -0
  85. data/lib/rails/generators/rails/plugin/templates/test/application_system_test_case.rb.tt +1 -1
  86. data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +6 -4
  87. data/lib/rails/generators/test_unit/mailer/templates/preview.rb.tt +3 -2
  88. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +15 -1
  89. data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +2 -2
  90. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +2 -2
  91. data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +2 -0
  92. data/lib/rails/generators/test_unit/system/templates/application_system_test_case.rb.tt +1 -1
  93. data/lib/rails/generators/testing/assertions.rb +20 -0
  94. data/lib/rails/generators/testing/behavior.rb +7 -6
  95. data/lib/rails/generators.rb +1 -1
  96. data/lib/rails/health_controller.rb +1 -1
  97. data/lib/rails/info.rb +2 -2
  98. data/lib/rails/info_controller.rb +2 -4
  99. data/lib/rails/mailers_controller.rb +14 -1
  100. data/lib/rails/paths.rb +2 -2
  101. data/lib/rails/pwa_controller.rb +15 -0
  102. data/lib/rails/rack/logger.rb +15 -7
  103. data/lib/rails/railtie/configurable.rb +2 -2
  104. data/lib/rails/railtie.rb +15 -16
  105. data/lib/rails/tasks/framework.rake +0 -26
  106. data/lib/rails/tasks/tmp.rake +1 -1
  107. data/lib/rails/templates/layouts/application.html.erb +1 -1
  108. data/lib/rails/templates/rails/mailers/email.html.erb +12 -8
  109. data/lib/rails/templates/rails/welcome/index.html.erb +4 -2
  110. data/lib/rails/test_help.rb +2 -4
  111. data/lib/rails/test_unit/reporter.rb +8 -2
  112. data/lib/rails/test_unit/runner.rb +26 -2
  113. data/lib/rails/test_unit/test_parser.rb +45 -0
  114. data/lib/rails.rb +6 -3
  115. metadata +45 -32
  116. data/lib/rails/app_updater.rb +0 -52
  117. data/lib/rails/commands/secrets/USAGE +0 -61
  118. data/lib/rails/commands/secrets/secrets_command.rb +0 -47
  119. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +0 -68
  120. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +0 -54
  121. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +0 -70
  122. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +0 -24
  123. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +0 -62
  124. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +0 -53
  125. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.tt +0 -280
  126. data/lib/rails/generators/rails/app/templates/public/apple-touch-icon-precomposed.png +0 -0
  127. data/lib/rails/generators/rails/app/templates/public/apple-touch-icon.png +0 -0
  128. data/lib/rails/generators/rails/app/templates/public/favicon.ico +0 -0
  129. data/lib/rails/ruby_version_check.rb +0 -17
  130. data/lib/rails/secrets.rb +0 -110
data/CHANGELOG.md CHANGED
@@ -1,956 +1,328 @@
1
- ## Rails 7.1.5.2 (August 13, 2025) ##
1
+ ## Rails 7.2.0 (August 09, 2024) ##
2
2
 
3
- * No changes.
4
-
5
-
6
- ## Rails 7.1.5.1 (December 10, 2024) ##
7
-
8
- * No changes.
9
-
10
-
11
- ## Rails 7.1.5 (October 30, 2024) ##
12
-
13
- * No changes.
14
-
15
-
16
- ## Rails 7.1.4.2 (October 23, 2024) ##
17
-
18
- * No changes.
19
-
20
-
21
- ## Rails 7.1.4.1 (October 15, 2024) ##
22
-
23
- * No changes.
24
-
25
-
26
- ## Rails 7.1.4 (August 22, 2024) ##
27
-
28
- * Preserve `--asset-pipeline propshaft` when running `app:update`.
29
-
30
- *Zacharias Knudsen*
31
-
32
- * Allow string keys for SQLCommenter.
33
-
34
- *Ngan Pham*
35
-
36
- * Fix derived foreign key to return correctly when association id is part of query constraints.
37
-
38
- *Varun Sharma*
39
-
40
- * Show warning for `secret_key_base` in development too.
41
-
42
- *fatkodima*
43
-
44
- * Fix sanitizer vendor configuration in 7.1 defaults.
45
-
46
- In apps where `rails-html-sanitizer` was not eagerly loaded, the sanitizer default could end up
47
- being Rails::HTML4::Sanitizer when it should be set to `Rails::HTML5::Sanitizer`.
48
-
49
- *Mike Dalessio*, *Rafael Mendonça França*
50
-
51
- * Revert the use of `Concurrent.physical_processor_count` in default Puma config
52
-
53
- While for many people this saves one config to set, for many others using
54
- a shared hosting solution, this cause the default configuration to spawn
55
- way more workers than reasonable.
56
-
57
- There is unfortunately no reliable way to detect how many cores an application
58
- can realistically use, and even then, assuming the application should use
59
- all the machine resources is often wrong.
60
-
61
- *Jean Boussier*
62
-
63
-
64
- ## Rails 7.1.3.4 (June 04, 2024) ##
65
-
66
- * No changes.
67
-
68
-
69
- ## Rails 7.1.3.3 (May 16, 2024) ##
70
-
71
- * No changes.
72
-
73
-
74
- ## Rails 7.1.3.2 (February 21, 2024) ##
75
-
76
- * No changes.
77
-
78
-
79
- ## Rails 7.1.3.1 (February 21, 2024) ##
80
-
81
- * No changes.
82
-
83
-
84
- ## Rails 7.1.3 (January 16, 2024) ##
85
-
86
- * Make sure `config.after_routes_loaded` hook runs on boot.
87
-
88
- *Rafael Mendonça França*
89
-
90
- * Fix `config.log_level` not being respected when using a `BroadcastLogger`
91
-
92
- *Édouard Chin*
93
-
94
- * Fix isolated engines to take `ActiveRecord::Base.table_name_prefix` into consideration.
95
- This will allow for engine defined models, such as inside Active Storage, to respect
96
- Active Record table name prefix configuration.
97
-
98
- *Chedli Bourguiba*
99
-
100
- * The `bin/rails app:template` command will no longer add potentially unwanted
101
- gem platforms via `bundle lock --add-platform=...` commands.
102
-
103
- *Jonathan Hefner*
104
-
105
-
106
- ## Rails 7.1.2 (November 10, 2023) ##
107
-
108
- * Fix running `db:system:change` when app has no Dockerfile.
109
-
110
- *Hartley McGuire*
111
-
112
- * If you accessed `config.eager_load_paths` and friends, later changes to
113
- `config.paths` were not reflected in the expected auto/eager load paths.
114
- Now, they are.
115
-
116
- This bug has been latent since Rails 3.
117
-
118
- Fixes #49629.
3
+ * The new `bin/rails boot` command boots the application and exits. Supports the
4
+ standard `-e/--environment` options.
119
5
 
120
6
  *Xavier Noria*
121
7
 
122
- ## Rails 7.1.1 (October 11, 2023) ##
123
-
124
- * Ensures the Rails generated Dockerfile uses correct ruby version and matches Gemfile.
125
-
126
- *Abhay Nikam*
127
-
128
-
129
- ## Rails 7.1.0 (October 05, 2023) ##
130
-
131
- * No changes.
132
-
133
-
134
- ## Rails 7.1.0.rc2 (October 01, 2023) ##
135
-
136
- * Always set the Rails logger to be an instance of `ActiveSupport::BroadcastLogger`.
137
-
138
- *Edouard Chin*
139
-
140
-
141
- ## Rails 7.1.0.rc1 (September 27, 2023) ##
142
-
143
- * Require `concurrent-ruby` in `config/puma.rb` so that Puma can boot in
144
- production when `WEB_CONCURRENCY` is not explicitly specified.
145
-
146
- Fixes #49323.
147
-
148
- *Matt Brictson*
149
-
150
- * Raise error when generating attribute with dangerous name.
151
-
152
- The following will now raise an error as `save` and `hash` are already
153
- defined by Active Record.
154
-
155
- ```bash
156
- $ bin/rails generate model Post save
157
- $ bin/rails generate model Post hash
158
- ```
159
-
160
- *Petrik de Heus*
161
-
162
-
163
- ## Rails 7.1.0.beta1 (September 13, 2023) ##
164
-
165
- * Add ability to show slow tests to the test runner
166
-
167
- ```bash
168
- $ bin/test --profile # additionally prints 10 (default) slowest tests
169
- # or
170
- $ bin/test --profile 20 # prints 20 slowest tests
171
- ```
172
-
173
- *fatkodima*
174
-
175
- * `rails new --javascript` generator now supports Bun
176
-
177
- ```bash
178
- $ rails new my_new_app --javascript=bun
179
- ```
8
+ * Create a Dev Container Generator that generates a Dev Container setup based on the current configuration
9
+ of the application. Usage:
180
10
 
181
- *Jason Meller*
11
+ `bin/rails devcontainer`
182
12
 
183
- * bin/setup uses `bun` instead of `yarn` when generated an app with bun
13
+ *Andrew Novoselac*
184
14
 
185
- Use `bun install` on `bin/setup` when using `bun`.
15
+ * Add Rubocop and GitHub Actions to plugin generator.
16
+ This can be skipped using --skip-rubocop and --skip-ci.
186
17
 
187
- *Cadu Ribeiro*
18
+ *Chris Oliver*
188
19
 
189
- * `config/application.rb` now includes
20
+ * Remove support for `oracle`, `sqlserver` and JRuby specific database adapters from the
21
+ `rails new` and `rails db:system:change` commands.
190
22
 
191
- ```ruby
192
- config.autoload_lib(ignore: %w(assets tasks))
193
- ```
23
+ The supported options are `sqlite3`, `mysql`, `postgresql` and `trilogy`.
194
24
 
195
- In practice, this means that new 7.1 applications autoload from `lib` out of the box.
25
+ *Andrew Novoselac*
196
26
 
197
- *Xavier Noria*
27
+ * Add options to `bin/rails app:update`.
198
28
 
199
- * Add an option to start rails console in sandbox mode by default
29
+ `bin/rails app:update` now supports the same generic options that generators do:
200
30
 
201
- `sandbox_by_default` option is added to start rails console in sandbox
202
- mode by default. With this option turned on, `--no-sandbox` must be
203
- specified to start rails in non-sandbox mode.
31
+ * `--force`: Accept all changes to existing files
32
+ * `--skip`: Refuse all changes to existing files
33
+ * `--pretend`: Don't make any changes
34
+ * `--quiet`: Don't output all changes made
204
35
 
205
- Note that this option is ignored when rails environment is development
206
- or test.
36
+ *Étienne Barrié*
207
37
 
208
- *Shouichi Kamiya*
38
+ * Implement Rails console commands and helpers with IRB v1.13's extension APIs.
209
39
 
210
- * Omit `webdrivers` gem dependency from `Gemfile` template
40
+ Rails console users will now see `helper`, `controller`, `new_session`, and `app` under
41
+ IRB help message's `Helper methods` category. And `reload!` command will be displayed under
42
+ the new `Rails console` commands category.
211
43
 
212
- *Sean Doyle*
44
+ Prior to this change, Rails console's commands and helper methods are added through IRB's
45
+ private components and don't show up in its help message, which led to poor discoverability.
213
46
 
214
- * Support filtering tests by line ranges
47
+ *Stan Lo*
215
48
 
216
- The new syntax allows you to filter tests by line ranges. For example, the
217
- following command runs tests from line 10 to 20.
49
+ * Remove deprecated `Rails::Generators::Testing::Behaviour`.
218
50
 
219
- ```bash
220
- $ rails test test/models/user_test.rb:10-20
221
- ```
51
+ *Rafael Mendonça França*
222
52
 
223
- *Shouichi Kamiya*, *Seonggi Yang*, *oljfte*, *Ryohei UEDA*
53
+ * Remove deprecated `find_cmd_and_exec` console helper.
224
54
 
225
- * Update default scaffold templates to set 303 (See Other) as status code
226
- on redirect for the update action for XHR requests other than GET or POST
227
- to avoid issues (e.g browsers trying to follow the redirect using the
228
- original request method resulting in double PATCH/PUT)
55
+ *Rafael Mendonça França*
229
56
 
230
- *Guillermo Iguaran*
57
+ * Remove deprecated `Rails.config.enable_dependency_loading`.
231
58
 
232
- * The new `config.autoload_lib_once` is similar to `config.autoload_lib`,
233
- except that it adds `lib` to `config.autoload_once_paths` instead.
59
+ *Rafael Mendonça França*
234
60
 
235
- By calling `config.autoload_lib_once`, classes and modules in `lib` can be
236
- autoloaded, even from application initializers, but won't be reloaded.
61
+ * Remove deprecated `Rails.application.secrets`.
237
62
 
238
- Please, see further details in the [autoloading
239
- guide](https://guides.rubyonrails.org/v7.1/autoloading_and_reloading_constants.html).
63
+ *Rafael Mendonça França*
240
64
 
241
- *Xavier Noria*
65
+ * Generated Gemfile will include `require: "debug/prelude"` for the `debug` gem.
242
66
 
243
- * Add `config.action_dispatch.debug_exception_log_level` to configure the log
244
- level used by `ActionDispatch::DebugExceptions`.
67
+ Requiring `debug` gem directly automatically activates it, which could introduce
68
+ additional overhead and memory usage even without entering a debugging session.
245
69
 
246
- The default is `:fatal`, but with `load_defaults "7.1"` the default will be
247
- `:error`.
70
+ By making Bundler require `debug/prelude` instead, developers can keep their access
71
+ to breakpoint methods like `debugger` or `binding.break`, but the debugger won't be
72
+ activated until a breakpoint is hit.
248
73
 
249
- *Hartley McGuire*
74
+ *Stan Lo*
250
75
 
251
- * Add `DATABASE` option to `railties:install:migrations`
76
+ * Skip generating a `test` job in ci.yml when a new application is generated with the
77
+ `--skip-test` option.
252
78
 
253
- This allows you to specify which database the migrations should be copied to
254
- when running `rails railties:install:migrations`.
79
+ *Steve Polito*
255
80
 
256
- ```bash
257
- $ rails railties:install:migrations DATABASE=animals
258
- ```
81
+ * Update the `.node-version` file conditionally generated for new applications to 20.11.1
259
82
 
260
- *Matthew Hirst*
83
+ *Steve Polito*
261
84
 
262
- * The new method `config.autoload_lib(ignore:)` provides a simple way to
263
- autoload from `lib`:
85
+ * Fix sanitizer vendor configuration in 7.1 defaults.
264
86
 
265
- ```ruby
266
- # config/application.rb
267
- config.autoload_lib(ignore: %w(assets tasks))
268
- ```
87
+ In apps where rails-html-sanitizer was not eagerly loaded, the sanitizer default could end up
88
+ being Rails::HTML4::Sanitizer when it should be set to Rails::HTML5::Sanitizer.
269
89
 
270
- Please, see further details in the [autoloading
271
- guide](https://guides.rubyonrails.org/v7.1/autoloading_and_reloading_constants.html).
90
+ *Mike Dalessio*, *Rafael Mendonça França*
272
91
 
273
- *Xavier Noria*
92
+ * Set `action_mailer.default_url_options` values in `development` and `test`.
274
93
 
275
- * Don't show secret_key_base for `Rails.application.config#inspect`.
94
+ Prior to this commit, new Rails applications would raise `ActionView::Template::Error`
95
+ if a mailer included a url built with a `*_path` helper.
276
96
 
277
- Before:
97
+ *Steve Polito*
278
98
 
279
- ```ruby
280
- Rails.application.config.inspect
281
- "#<Rails::Application::Configuration:0x00000001132b02a0 @root=... @secret_key_base=\"b3c631c314c0bbca50c1b2843150fe33\" ... >"
282
- ```
99
+ * Introduce `Rails::Generators::Testing::Assertions#assert_initializer`.
283
100
 
284
- After:
101
+ Compliments the existing `initializer` generator action.
285
102
 
286
- ```ruby
287
- Rails.application.config.inspect
288
- "#<Rails::Application::Configuration:0x00000001132b02a0>"
103
+ ```rb
104
+ assert_initializer "mail_interceptors.rb"
289
105
  ```
290
106
 
291
- *Petrik de Heus*
292
-
293
- * Deprecate calling `Rails.application.secrets`.
294
-
295
- Rails `secrets` have been deprecated in favor of `credentials`.
296
- Calling `Rails.application.secrets` should show a deprecation warning.
297
-
298
- *Petrik de Heus*
299
-
300
- * Store `secret_key_base` in `Rails.config` for local environments.
301
-
302
- Rails `secrets` have been deprecated in favor of `credentials`.
303
- For the local environments the `secret_key_base` is now stored in
304
- `Rails.config.secret_key_base` instead of the soft deprecated
305
- `Rails.application.secrets.secret_key_base`.
306
-
307
- *Petrik de Heus*
308
-
309
- * Enable force_ssl=true in production by default: Force all access to the app over SSL,
310
- use Strict-Transport-Security, and use secure cookies
311
-
312
- *Justin Searls*, *Aaron Patterson*, *Guillermo Iguaran*, *Vinícius Bispo*
313
-
314
- * Add engine's draw paths to application route set, so that the application
315
- can draw route files defined in engine paths.
316
-
317
- *Gannon McGibbon*
318
-
319
- * Support `VISUAL` environment variable for commands which open an editor,
320
- and prefer it over `EDITOR`.
321
-
322
- *Summer ☀️*
323
-
324
- * Add engine's `test/fixtures` path to `fixture_paths` in `on_load` hook if
325
- path exists and is under the Rails application root.
326
-
327
- *Chris Salzberg*
107
+ *Steve Polito*
328
108
 
329
- * `bin/rails app:template` now runs `bundle install` and any `after_bundle`
330
- blocks after the template is executed.
109
+ * Generate a .devcontainer folder and its contents when creating a new app.
331
110
 
332
- *Jonathan Hefner* and *Gerry Caulfield*
111
+ The .devcontainer folder includes everything needed to boot the app and do development in a remote container.
333
112
 
334
- * Enable passing column size to migration generator
113
+ The container setup includes:
114
+ - A redis container for Kredis, ActionCable etc.
115
+ - A database (SQLite, Postgres, MySQL or MariaDB)
116
+ - A Headless chrome container for system tests
117
+ - Active Storage configured to use the local disk and with preview features working
335
118
 
336
- Previously you could pass a limit to the migration generator:
119
+ If any of these options are skipped in the app setup they will not be included in the container configuration.
337
120
 
338
- `rails generate migration CreateAuthor name:text{65535}`
121
+ These files can be skipped using the `--skip-devcontainer` option.
339
122
 
340
- Now, a size attribute can be passed to the migration generator:
123
+ *Andrew Novoselac & Rafael Mendonça França*
341
124
 
342
- `rails generate migration CreateAuthor name:text{medium}`
125
+ * Introduce `SystemTestCase#served_by` for configuring the System Test application server.
343
126
 
344
- This generates a migration which includes the size attribute:
127
+ By default this is localhost. This method allows the host and port to be specified manually.
345
128
 
346
129
  ```ruby
347
- class CreateAuthor < ActiveRecord::Migration[7.1]
348
- def change
349
- create_table :authors do |t|
350
- t.text :name, size: :medium
351
- end
352
- end
130
+ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
131
+ served_by host: "testserver", port: 45678
353
132
  end
354
133
  ```
355
134
 
356
- *Josh Broughton*, *Hartley McGuire*
135
+ *Andrew Novoselac & Rafael Mendonça França*
357
136
 
358
- * Trying to set a config key with the same name of a method now raises:
137
+ * `bin/rails test` will no longer load files named `*_test.rb` if they are located in the `fixtures` folder.
359
138
 
360
- ```ruby
361
- config.load_defaults = 7.0
362
- # NoMethodError: Cannot assign to `load_defaults`, it is a configuration method
363
- ```
364
-
365
- *Xavier Noria*
366
-
367
- * Deprecate `secrets:edit/show` and remove `secrets:setup`
368
-
369
- `bin/rails secrets:setup` has been deprecated since Rails 5.2 in favor of
370
- credentials. This command has been removed.
371
-
372
- `bin/rails secrets:show` and `bin/rails secrets:edit` have been deprecated
373
- in favor of credentials.
374
-
375
- Run `bin/rails credentials:help` for more information
376
-
377
- *Petrik de Heus*
378
-
379
- * `bin/rails --help` will now list only framework and plugin commands. Rake
380
- tasks defined in `lib/tasks/*.rake` files will no longer be included. For a
381
- list of those tasks, use `rake -T`.
139
+ *Edouard Chin*
382
140
 
383
- *Jonathan Hefner*
141
+ * Ensure logger tags configured with `config.log_tags` are still active in `request.action_dispatch` handlers.
384
142
 
385
- * Allow calling `bin/rails restart` outside of app directory.
143
+ *KJ Tsanaktsidis*
386
144
 
387
- The following would previously fail with a "No Rakefile found" error.
145
+ * Setup jemalloc in the default Dockerfile for memory optimization.
388
146
 
389
- ```bash
390
- $ blog/bin/rails restart
391
- ```
147
+ *Matt Almeida*, *Jean Boussier*
392
148
 
393
- *Petrik de Heus*
149
+ * Commented out lines in .railsrc file should not be treated as arguments when using
150
+ rails new generator command. Update ARGVScrubber to ignore text after `#` symbols.
394
151
 
395
- * Support prerelease rubies in Gemfile template if RubyGems version is 3.3.13 or higher.
152
+ *Willian Tenfen*
396
153
 
397
- *Yasuo Honda*, *David Rodríguez*
154
+ * Skip CSS when generating APIs.
398
155
 
399
- * Autoloading setup honors root directories manually set by the user.
156
+ *Ruy Rocha*
400
157
 
401
- This is relevant for custom namespaces. For example, if you'd like classes
402
- and modules under `app/services` to be defined in the `Services` namespace
403
- without an extra `app/services/services` directory, this is now enough:
404
-
405
- ```ruby
406
- # config/initializers/autoloading.rb
158
+ * Rails console now indicates application name and the current Rails environment:
407
159
 
408
- # The namespace has to exist.
409
- #
410
- # In this example we define the module on the spot. Could also be created
411
- # elsewhere and its definition loaded here with an ordinary `require`. In
412
- # any case, `push_dir` expects a class or module object.
413
- module Services; end
414
-
415
- Rails.autoloaders.main.push_dir("#{Rails.root}/app/services", namespace: Services)
160
+ ```txt
161
+ my-app(dev)> # for RAILS_ENV=development
162
+ my-app(test)> # for RAILS_ENV=test
163
+ my-app(prod)> # for RAILS_ENV=production
164
+ my-app(my_env)> # for RAILS_ENV=my_env
416
165
  ```
417
166
 
418
- Check the autoloading guide for further details.
419
-
420
- *Xavier Noria*
167
+ The application name is derived from the application's module name from `config/application.rb`.
168
+ For example, `MyApp` will displayed as `my-app` in the prompt.
421
169
 
422
- * Railties now requires the irb gem as a dependency, which means when you install Rails, irb will also
423
- be installed as a gem. Rails will then use the installed version of irb for its console instead of
424
- relying on Ruby's built-in version.
425
- This ensures that Rails has access to the most up-to-date and reliable version of irb for its console.
170
+ Additionally, the environment name will be colorized when the environment is
171
+ `development` (blue), `test` (blue), or `production` (red), if your
172
+ terminal supports it.
426
173
 
427
174
  *Stan Lo*
428
175
 
429
- * Use infinitive form for all rails command descriptions verbs.
430
-
431
- *Petrik de Heus*
176
+ * Ensure `autoload_paths`, `autoload_once_paths`, `eager_load_paths`, and
177
+ `load_paths` only have directories when initialized from engine defaults.
432
178
 
433
- * Credentials commands (e.g. `bin/rails credentials:edit`) now respect
434
- `config.credentials.content_path` and `config.credentials.key_path` when set
435
- in `config/application.rb` or `config/environments/#{Rails.env}.rb`.
179
+ Previously, files under the `app` directory could end up there too.
436
180
 
437
- Before:
181
+ *Takumasa Ochi*
438
182
 
439
- * `bin/rails credentials:edit` ignored `RAILS_ENV`, and would always edit
440
- `config/credentials.yml.enc`.
183
+ * Prevent unnecessary application reloads in development.
441
184
 
442
- * `bin/rails credentials:edit --environment foo` would create and edit
443
- `config/credentials/foo.yml.enc`.
185
+ Previously, some files outside autoload paths triggered unnecessary reloads.
186
+ With this fix, application reloads according to `Rails.autoloaders.main.dirs`,
187
+ thereby preventing unnecessary reloads.
444
188
 
445
- * If `config.credentials.content_path` or `config.credentials.key_path`
446
- was set, `bin/rails credentials:edit` could not be used to edit the
447
- credentials. Editing credentials required using `bin/rails
448
- encrypted:edit path/to/credentials --key path/to/key`.
189
+ *Takumasa Ochi*
449
190
 
450
- After:
191
+ * Use `oven-sh/setup-bun` in GitHub CI when generating an app with Bun.
451
192
 
452
- * `bin/rails credentials:edit` will edit the credentials file that the app
453
- would load for the current `RAILS_ENV`.
193
+ *TangRufus*
454
194
 
455
- * `bin/rails credentials:edit` respects `config.credentials.content_path`
456
- and `config.credentials.key_path` when set in `config/application.rb`
457
- or `config/environments/#{Rails.env}.rb`.
195
+ * Disable `pidfile` generation in the `production` environment.
458
196
 
459
- * `bin/rails credentials:edit --environment foo` will create and edit
460
- `config/credentials/foo.yml.enc` _if_ `config.credentials.content_path`
461
- has not been set for the `foo` environment. Ultimately, it will edit
462
- the credentials file that the app would load for the `foo` environment.
197
+ *Hans Schnedlitz*
463
198
 
464
- *Jonathan Hefner*
199
+ * Set `config.action_view.annotate_rendered_view_with_filenames` to `true` in
200
+ the `development` environment.
465
201
 
466
- * Add descriptions for non-Rake commands when running `rails -h`.
202
+ *Adrian Marin*
467
203
 
468
- *Petrik de Heus*
204
+ * Support the `BACKTRACE` environment variable to turn off backtrace cleaning.
469
205
 
470
- * Show relevant commands when calling help
206
+ Useful for debugging framework code:
471
207
 
472
- When running `rails -h` or just `rails` outside a Rails application,
473
- Rails outputs all options for running the `rails new` command. This can be
474
- confusing to users when they probably want to see the common Rails commands.
475
-
476
- Instead, we should always show the common commands when running `rails -h`
477
- inside or outside a Rails application.
478
-
479
- As the relevant commands inside a Rails application differ from the
480
- commands outside an application, the help USAGE file has been split to
481
- show the most relevant commands for the context.
482
-
483
- *Petrik de Heus*
484
-
485
- * Add Rails::HealthController#show and map it to /up for newly generated applications.
486
- Load balancers and uptime monitors all need a basic endpoint to tell whether the app is up.
487
- This is a good starting point that'll work in many situations.
488
-
489
- *DHH*
208
+ ```sh
209
+ BACKTRACE=1 bin/rails server
210
+ ```
490
211
 
491
- * Only use HostAuthorization middleware if `config.hosts` is not empty
212
+ *Alex Ghiculescu*
492
213
 
493
- *Hartley McGuire*
494
-
495
- * Raise an exception when a `before_action`'s "only" or "except" filter
496
- options reference an action that doesn't exist. This will be enabled by
497
- default but can be overridden via config.
214
+ * Raise `ArgumentError` when reading `config.x.something` with arguments:
498
215
 
499
216
  ```ruby
500
- # config/environments/production.rb
501
- config.action_controller.raise_on_missing_callback_actions = false
217
+ config.x.this_works.this_raises true # raises ArgumentError
502
218
  ```
503
219
 
504
- *Jess Bees*
220
+ *Sean Doyle*
505
221
 
506
- * Use physical processor count as the default Puma worker count in production.
507
- This can be overridden by setting `ENV["WEB_CONCURRENCY"]` or editing the
508
- generated "config/puma.rb" directly.
222
+ * Add default PWA files for manifest and service-worker that are served from `app/views/pwa` and can be dynamically rendered through ERB. Mount these files explicitly at the root with default routes in the generated routes file.
509
223
 
510
224
  *DHH*
511
225
 
512
- * Add Docker files by default to new apps: Dockerfile, .dockerignore, bin/docker-entrypoint.
513
- These files can be skipped with `--skip-docker`. They're intended as a starting point for
514
- a production deploy of the application. Not intended for development (see Docked Rails for that).
515
-
516
- Example:
517
-
518
- ```bash
519
- $ docker build -t app .
520
- $ docker volume create app-storage
521
- $ docker run --rm -it -v app-storage:/rails/storage -p 3000:3000 --env RAILS_MASTER_KEY=<see config/master.key> app
522
- ```
523
-
524
- You can also start a console or a runner from this image:
525
-
526
- ```bash
527
- $ docker run --rm -it -v app-storage:/rails/storage --env RAILS_MASTER_KEY=<see config/master.key> app console
528
- ```
529
-
530
- To create a multi-platform image on Apple Silicon to deploy on AMD or Intel and push to Docker Hub for user/app:
531
-
532
- ```bash
533
- $ docker login -u <user>
534
- $ docker buildx create --use
535
- $ docker buildx build --push --platform=linux/amd64,linux/arm64 -t <user/image> .
536
- ```
537
-
538
- *DHH, Sam Ruby*
539
-
540
- * Add ENV["SECRET_KEY_BASE_DUMMY"] for starting production environment with a generated secret base key,
541
- which can be used to run tasks like `assets:precompile` without making the RAILS_MASTER_KEY available
542
- to the build process.
543
-
544
- Dockerfile layer example:
545
-
546
- ```
547
- RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile
548
- ```
226
+ * Updated system tests to now use headless Chrome by default for the new applications.
549
227
 
550
228
  *DHH*
551
229
 
552
- * Show descriptions for all commands in Rails help
553
-
554
- When calling `rails help` most commands missed their description. We now
555
- show the same descriptions as shown in `rails -T`.
556
-
557
- *Petrik de Heus*
558
-
559
- * Always generate the storage/ directory with rails new to ensure there's a stable place to
560
- put permanent files, and a single mount point for containers to map. Then default sqlite3 databases
561
- to live there instead of db/, which is only meant for configuration, not data.
230
+ * Add GitHub CI files for Dependabot, Brakeman, RuboCop, and running tests by default. Can be skipped with `--skip-ci`.
562
231
 
563
232
  *DHH*
564
233
 
565
- * Rails console now disables `IRB`'s autocompletion feature in production by default.
566
-
567
- Setting `IRB_USE_AUTOCOMPLETE=true` can override this default.
568
-
569
- *Stan Lo*
570
-
571
- * Add `config.precompile_filter_parameters`, which enables precompilation of
572
- `config.filter_parameters` using `ActiveSupport::ParameterFilter.precompile_filters`.
573
- Precompilation can improve filtering performance, depending on the quantity
574
- and types of filters.
575
-
576
- `config.precompile_filter_parameters` defaults to `true` for
577
- `config.load_defaults 7.1` and above.
578
-
579
- *Jonathan Hefner*
580
-
581
- * Add `after_routes_loaded` hook to `Rails::Railtie::Configuration` for
582
- engines to add a hook to be called after application routes have been
583
- loaded.
584
-
585
- ```ruby
586
- MyEngine.config.after_routes_loaded do
587
- # code that must happen after routes have been loaded
588
- end
589
- ```
590
-
591
- *Chris Salzberg*
592
-
593
- * Send 303 See Other status code back for the destroy action on newly generated
594
- scaffold controllers.
595
-
596
- *Tony Drake*
597
-
598
- * Add `Rails.application.deprecators` as a central point to manage deprecators
599
- for an application.
600
-
601
- Individual deprecators can be added and retrieved from the collection:
602
-
603
- ```ruby
604
- Rails.application.deprecators[:my_gem] = ActiveSupport::Deprecation.new("2.0", "MyGem")
605
- Rails.application.deprecators[:other_gem] = ActiveSupport::Deprecation.new("3.0", "OtherGem")
606
- ```
607
-
608
- And the collection's configuration methods affect all deprecators in the
609
- collection:
610
-
611
- ```ruby
612
- Rails.application.deprecators.debug = true
613
-
614
- Rails.application.deprecators[:my_gem].debug
615
- # => true
616
- Rails.application.deprecators[:other_gem].debug
617
- # => true
618
- ```
619
-
620
- Additionally, all deprecators in the collection can be silenced for the
621
- duration of a given block:
622
-
623
- ```ruby
624
- Rails.application.deprecators.silence do
625
- Rails.application.deprecators[:my_gem].warn # => silenced (no warning)
626
- Rails.application.deprecators[:other_gem].warn # => silenced (no warning)
627
- end
628
- ```
629
-
630
- *Jonathan Hefner*
631
-
632
- * Move dbconsole logic to Active Record connection adapter.
633
-
634
- Instead of hosting the connection logic in the command object, the
635
- database adapter should be responsible for connecting to a console session.
636
- This patch moves #find_cmd_and_exec to the adapter and exposes a new API to
637
- lookup the adapter class without instantiating it.
638
-
639
- *Gannon McGibbon*, *Paarth Madan*
640
-
641
- * Add `Rails.application.message_verifiers` as a central point to configure
642
- and create message verifiers for an application.
643
-
644
- This allows applications to, for example, rotate old `secret_key_base`
645
- values:
646
-
647
- ```ruby
648
- config.before_initialize do |app|
649
- app.message_verifiers.rotate(secret_key_base: "old secret_key_base")
650
- end
651
- ```
652
-
653
- And for libraries to create preconfigured message verifiers:
654
-
655
- ```ruby
656
- ActiveStorage.verifier = Rails.application.message_verifiers["ActiveStorage"]
657
- ```
658
-
659
- *Jonathan Hefner*
660
-
661
- * Support MySQL's ssl-mode option for the dbconsole command.
662
-
663
- Verifying the identity of the database server requires setting the ssl-mode
664
- option to VERIFY_CA or VERIFY_IDENTITY. This option was previously ignored
665
- for the dbconsole command.
666
-
667
- *Petrik de Heus*
234
+ * Add Brakeman by default for static analysis of security vulnerabilities. Allow skipping with `--skip-brakeman option`.
668
235
 
669
- * Delegate application record generator description to orm hooked generator.
236
+ *vipulnsward*
670
237
 
671
- *Gannon McGibbon*
238
+ * Add RuboCop with rules from `rubocop-rails-omakase` by default. Skip with `--skip-rubocop`.
672
239
 
673
- * Show BCC recipients when present in Action Mailer previews.
240
+ *DHH* and *zzak*
674
241
 
675
- *Akshay Birajdar*
242
+ * Use `bin/rails runner --skip-executor` to not wrap the runner script with an
243
+ Executor.
676
244
 
677
- * Extend `routes --grep` to also filter routes by matching against path.
245
+ *Ben Sheldon*
678
246
 
679
- Example:
680
-
681
- ```bash
682
- $ bin/rails routes --grep /cats/1
683
- Prefix Verb URI Pattern Controller#Action
684
- cat GET /cats/:id(.:format) cats#show
685
- PATCH /cats/:id(.:format) cats#update
686
- PUT /cats/:id(.:format) cats#update
687
- DELETE /cats/:id(.:format) cats#destroy
688
- ```
689
-
690
- *Orhan Toy*
691
-
692
- * Improve `rails runner` output when given a file path that doesn't exist.
693
-
694
- *Tekin Suleyman*
695
-
696
- * `config.allow_concurrency = false` now use a `Monitor` instead of a `Mutex`
697
-
698
- This allows to enable `config.active_support.executor_around_test_case` even
699
- when `config.allow_concurrency` is disabled.
700
-
701
- *Jean Boussier*
702
-
703
- * Add `routes --unused` option to detect extraneous routes.
704
-
705
- Example:
706
-
707
- ```bash
708
- $ bin/rails routes --unused
709
-
710
- Found 2 unused routes:
711
-
712
- Prefix Verb URI Pattern Controller#Action
713
- one GET /one(.:format) action#one
714
- two GET /two(.:format) action#two
715
- ```
716
-
717
- *Gannon McGibbon*
718
-
719
- * Add `--parent` option to controller generator to specify parent class of job.
720
-
721
- Example:
722
-
723
- `bin/rails g controller admin/users --parent=admin_controller` generates:
724
-
725
- ```ruby
726
- class Admin::UsersController < AdminController
727
- # ...
728
- end
729
- ```
730
-
731
- *Gannon McGibbon*
732
-
733
- * In-app custom credentials templates are now supported. When a credentials
734
- file does not exist, `rails credentials:edit` will now try to use
735
- `lib/templates/rails/credentials/credentials.yml.tt` to generate the
736
- credentials file, before falling back to the default template.
737
-
738
- This allows e.g. an open-source Rails app (which would not include encrypted
739
- credentials files in its repo) to include a credentials template, so that
740
- users who install the app will get a custom pre-filled credentials file when
741
- they run `rails credentials:edit`.
742
-
743
- *Jonathan Hefner*
744
-
745
- * Except for `dev` and `test` environments, newly generated per-environment
746
- credentials files (e.g. `config/credentials/production.yml.enc`) now include
747
- a `secret_key_base` for convenience, just as `config/credentials.yml.enc`
748
- does.
749
-
750
- *Jonathan Hefner*
751
-
752
- * `--no-*` options now work with the app generator's `--minimal` option, and
753
- are both comprehensive and precise. For example:
754
-
755
- ```bash
756
- $ rails new my_cool_app --minimal
757
- Based on the specified options, the following options will also be activated:
758
-
759
- --skip-active-job [due to --minimal]
760
- --skip-action-mailer [due to --skip-active-job, --minimal]
761
- --skip-active-storage [due to --skip-active-job, --minimal]
762
- --skip-action-mailbox [due to --skip-active-storage, --minimal]
763
- --skip-action-text [due to --skip-active-storage, --minimal]
764
- --skip-javascript [due to --minimal]
765
- --skip-hotwire [due to --skip-javascript, --minimal]
766
- --skip-action-cable [due to --minimal]
767
- --skip-bootsnap [due to --minimal]
768
- --skip-dev-gems [due to --minimal]
769
- --skip-system-test [due to --minimal]
770
-
771
- ...
772
-
773
- $ rails new my_cool_app --minimal --no-skip-active-storage
774
- Based on the specified options, the following options will also be activated:
775
-
776
- --skip-action-mailer [due to --minimal]
777
- --skip-action-mailbox [due to --minimal]
778
- --skip-action-text [due to --minimal]
779
- --skip-javascript [due to --minimal]
780
- --skip-hotwire [due to --skip-javascript, --minimal]
781
- --skip-action-cable [due to --minimal]
782
- --skip-bootsnap [due to --minimal]
783
- --skip-dev-gems [due to --minimal]
784
- --skip-system-test [due to --minimal]
785
-
786
- ...
787
- ```
788
-
789
- *Brad Trick* and *Jonathan Hefner*
790
-
791
- * Add `--skip-dev-gems` option to app generator to skip adding development
792
- gems (like `web-console`) to the Gemfile.
793
-
794
- *Brad Trick*
795
-
796
- * Skip Active Storage and Action Mailer if Active Job is skipped.
797
-
798
- *Étienne Barrié*
799
-
800
- * Correctly check if frameworks are disabled when running app:update.
247
+ * Fix isolated engines to take `ActiveRecord::Base.table_name_prefix` into consideration.
801
248
 
802
- *Étienne Barrié* and *Paulo Barros*
249
+ This will allow for engine defined models, such as inside Active Storage, to respect
250
+ Active Record table name prefix configuration.
803
251
 
804
- * Delegate model generator description to orm hooked generator.
252
+ *Chedli Bourguiba*
805
253
 
806
- *Gannon McGibbon*
254
+ * Fix running `db:system:change` when the app has no Dockerfile.
807
255
 
808
- * Execute `rails runner` scripts inside the executor.
256
+ *Hartley McGuire*
809
257
 
810
- Enables error reporting, query cache, etc.
258
+ * In Action Mailer previews, list inline attachments separately from normal
259
+ attachments.
811
260
 
812
- *Jean Boussier*
261
+ For example, attachments that were previously listed like
813
262
 
814
- * Avoid booting in development then test for test tasks.
263
+ > Attachments: logo.png file1.pdf file2.pdf
815
264
 
816
- Running one of the rails test subtasks (e.g. test:system, test:models) would
817
- go through Rake and cause the app to be booted twice. Now all the test:*
818
- subtasks are defined as Thor tasks and directly load the test environment.
265
+ will now be listed like
819
266
 
820
- *Étienne Barrié*
267
+ > Attachments: file1.pdf file2.pdf (Inline: logo.png)
821
268
 
822
- * Deprecate `Rails::Generators::Testing::Behaviour` in favor of `Rails::Generators::Testing::Behavior`.
269
+ *Christian Schmidt* and *Jonathan Hefner*
823
270
 
824
- *Gannon McGibbon*
271
+ * In mailer preview, only show SMTP-To if it differs from the union of To, Cc and Bcc.
825
272
 
826
- * Allow configuration of logger size for local and test environments
273
+ *Christian Schmidt*
827
274
 
828
- `config.log_file_size`
275
+ * Enable YJIT by default on new applications running Ruby 3.3+.
829
276
 
830
- Defaults to `100` megabytes.
277
+ This can be disabled by setting `Rails.application.config.yjit = false`
831
278
 
832
- *Bernie Chiu*
279
+ *Jean Boussier*, *Rafael Mendonça França*
833
280
 
834
- * Enroll new apps in decrypted diffs of credentials by default. This behavior
835
- can be opted out of with the app generator's `--skip-decrypted-diffs` flag.
281
+ * In Action Mailer previews, show date from message `Date` header if present.
836
282
 
837
- *Jonathan Hefner*
283
+ *Sampat Badhe*
838
284
 
839
- * Support declarative-style test name filters with `bin/rails test`.
285
+ * Exit with non-zero status when the migration generator fails.
840
286
 
841
- This makes it possible to run a declarative-style test such as:
287
+ *Katsuhiko YOSHIDA*
842
288
 
843
- ```ruby
844
- class MyTest < ActiveSupport::TestCase
845
- test "does something" do
846
- # ...
847
- end
848
- end
849
- ```
289
+ * Use numeric UID and GID in Dockerfile template.
850
290
 
851
- Using its declared name:
291
+ The Dockerfile generated by `rails new` sets the default user and group
292
+ by name instead of UID:GID. This can cause the following error in Kubernetes:
852
293
 
853
- ```bash
854
- $ bin/rails test test/my_test.rb -n "does something"
855
294
  ```
856
-
857
- Instead of having to specify its expanded method name:
858
-
859
- ```bash
860
- $ bin/rails test test/my_test.rb -n test_does_something
295
+ container has runAsNonRoot and image has non-numeric user (rails), cannot verify user is non-root
861
296
  ```
862
297
 
863
- *Jonathan Hefner*
864
-
865
- * Add `--js` and `--skip-javascript` options to `rails new`
866
-
867
- `--js` alias to `rails new --javascript ...`
868
-
869
- Same as `-j`, e.g. `rails new --js esbuild ...`
870
-
871
- `--skip-js` alias to `rails new --skip-javascript ...`
872
-
873
- Same as `-J`, e.g. `rails new --skip-js ...`
298
+ This change sets default user and group by their numeric values.
874
299
 
875
- *Dorian Marié*
876
-
877
- * Allow relative paths with leading dot slash to be passed to `rails test`.
878
-
879
- Fix `rails test ./test/model/post_test.rb` to run a single test file.
880
-
881
- *Shouichi Kamiya* and *oljfte*
882
-
883
- * 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.
884
-
885
- *Xavier Noria*
886
-
887
- * 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.
888
-
889
- *Xavier Noria*
300
+ *Ivan Fedotov*
890
301
 
891
- * Add JavaScript dependencies installation on bin/setup
302
+ * Disallow invalid values for rails new options.
892
303
 
893
- Add `yarn install` to bin/setup when using esbuild, webpack, or rollout.
304
+ The `--database`, `--asset-pipeline`, `--css`, and `--javascript` options
305
+ for `rails new` take different arguments. This change validates them.
894
306
 
895
- *Carlos Ribeiro*
307
+ *Tony Drake*, *Akhil G Krishnan*, *Petrik de Heus*
896
308
 
897
- * Use `controller_class_path` in `Rails::Generators::NamedBase#route_url`
309
+ * Conditionally print `$stdout` when invoking `run_generator`.
898
310
 
899
- The `route_url` method now returns the correct path when generating
900
- a namespaced controller with a top-level model using `--model-name`.
311
+ In an effort to improve the developer experience when debugging
312
+ generator tests, we add the ability to conditionally print `$stdout`
313
+ instead of capturing it.
901
314
 
902
- Previously, when running this command:
315
+ This allows for calls to `binding.irb` and `puts` work as expected.
903
316
 
904
- ```bash
905
- $ bin/rails generate scaffold_controller Admin/Post --model-name Post
317
+ ```sh
318
+ RAILS_LOG_TO_STDOUT=true ./bin/test test/generators/actions_test.rb
906
319
  ```
907
320
 
908
- the comments above the controller action would look like:
909
-
910
- ``` ruby
911
- # GET /posts
912
- def index
913
- @posts = Post.all
914
- end
915
- ```
916
-
917
- afterwards, they now look like this:
918
-
919
- ``` ruby
920
- # GET /admin/posts
921
- def index
922
- @posts = Post.all
923
- end
924
- ```
925
-
926
- Fixes #44662.
927
-
928
- *Andrew White*
929
-
930
- * No longer add autoloaded paths to `$LOAD_PATH`.
931
-
932
- This means it won't be possible to load them with a manual `require` call, the class or module can be referenced instead.
933
-
934
- Reducing the size of `$LOAD_PATH` speed-up `require` calls for apps not using `bootsnap`, and reduce the
935
- size of the `bootsnap` cache for the others.
936
-
937
- *Jean Boussier*
938
-
939
- * Remove default `X-Download-Options` header
940
-
941
- This header is currently only used by Internet Explorer which
942
- will be discontinued in 2022 and since Rails 7 does not fully
943
- support Internet Explorer this header should not be a default one.
944
-
945
- *Harun Sabljaković*
946
-
947
- * Add .node-version files for Rails apps that use Node.js
948
-
949
- Node version managers that make use of this file:
950
- https://github.com/shadowspawn/node-version-usage#node-version-file-usage
321
+ *Steve Polito*
951
322
 
952
- The generated Dockerfile will use the same node version.
323
+ * Remove the option `config.public_file_server.enabled` from the generators
324
+ for all environments, as the value is the same in all environments.
953
325
 
954
- *Sam Ruby*
326
+ *Adrian Hirt*
955
327
 
956
- Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/railties/CHANGELOG.md) for previous changes.
328
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/railties/CHANGELOG.md) for previous changes.