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