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