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