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