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