railties 7.2.1.1 → 8.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +122 -278
- data/lib/minitest/rails_plugin.rb +1 -1
- data/lib/rails/application/bootstrap.rb +0 -1
- data/lib/rails/application/configuration.rb +15 -14
- data/lib/rails/application/default_middleware_stack.rb +4 -0
- data/lib/rails/application/finisher.rb +2 -3
- data/lib/rails/application/routes_reloader.rb +11 -1
- data/lib/rails/application.rb +5 -0
- data/lib/rails/code_statistics.rb +128 -86
- data/lib/rails/code_statistics_calculator.rb +78 -76
- data/lib/rails/command/helpers/editor.rb +1 -1
- data/lib/rails/command.rb +0 -6
- data/lib/rails/commands/app/update_command.rb +1 -9
- data/lib/rails/commands/console/irb_console.rb +11 -8
- data/lib/rails/commands/credentials/USAGE +4 -4
- data/lib/rails/commands/credentials/credentials_command.rb +5 -1
- data/lib/rails/commands/dev/dev_command.rb +1 -1
- data/lib/rails/commands/devcontainer/devcontainer_command.rb +2 -1
- data/lib/rails/commands/stats/stats_command.rb +19 -0
- data/lib/rails/console/methods.rb +5 -21
- data/lib/rails/dev_caching.rb +2 -2
- data/lib/rails/engine/configuration.rb +3 -1
- data/lib/rails/engine/lazy_route_set.rb +114 -0
- data/lib/rails/engine.rb +12 -8
- data/lib/rails/gem_version.rb +4 -4
- data/lib/rails/generators/app_base.rb +46 -28
- data/lib/rails/generators/base.rb +0 -4
- data/lib/rails/generators/database.rb +101 -67
- data/lib/rails/generators/erb/authentication/authentication_generator.rb +15 -0
- data/lib/rails/generators/erb/authentication/templates/app/views/passwords/edit.html.erb +9 -0
- data/lib/rails/generators/erb/authentication/templates/app/views/passwords/new.html.erb +8 -0
- data/lib/rails/generators/erb/authentication/templates/app/views/sessions/new.html.erb +11 -0
- data/lib/rails/generators/generated_attribute.rb +16 -11
- data/lib/rails/generators/rails/app/app_generator.rb +20 -32
- data/lib/rails/generators/rails/app/templates/Dockerfile.tt +13 -4
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +25 -10
- data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css.tt +6 -11
- data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +10 -3
- data/lib/rails/generators/rails/app/templates/bin/dev.tt +1 -0
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +5 -8
- data/lib/rails/generators/rails/app/templates/bin/thrust.tt +4 -0
- data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +23 -0
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +23 -0
- data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +40 -0
- data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +23 -0
- data/lib/rails/generators/rails/app/templates/config/deploy.yml.tt +128 -0
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +12 -23
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +34 -51
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +5 -19
- data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +0 -7
- 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_8_0.rb.tt +25 -0
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +11 -2
- data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +3 -3
- data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +4 -3
- data/lib/rails/generators/rails/app/templates/dockerignore.tt +1 -2
- data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +5 -1
- data/lib/rails/generators/rails/app/templates/gitignore.tt +1 -2
- data/lib/rails/generators/rails/app/templates/kamal-secrets.tt +17 -0
- data/lib/rails/generators/rails/app/templates/public/400.html +114 -0
- data/lib/rails/generators/rails/app/templates/public/404.html +113 -66
- data/lib/rails/generators/rails/app/templates/public/406-unsupported-browser.html +113 -65
- data/lib/rails/generators/rails/app/templates/public/422.html +113 -66
- data/lib/rails/generators/rails/app/templates/public/500.html +113 -65
- data/lib/rails/generators/rails/app/templates/public/icon.png +0 -0
- data/lib/rails/generators/rails/app/templates/public/icon.svg +2 -2
- data/lib/rails/generators/rails/authentication/USAGE +6 -0
- data/lib/rails/generators/rails/authentication/authentication_generator.rb +56 -0
- data/lib/rails/generators/rails/authentication/templates/app/controllers/concerns/authentication.rb.tt +55 -0
- data/lib/rails/generators/rails/authentication/templates/app/controllers/passwords_controller.rb.tt +33 -0
- data/lib/rails/generators/rails/authentication/templates/app/controllers/sessions_controller.rb.tt +21 -0
- data/lib/rails/generators/rails/authentication/templates/app/mailers/passwords_mailer.rb.tt +6 -0
- data/lib/rails/generators/rails/authentication/templates/app/models/current.rb.tt +4 -0
- data/lib/rails/generators/rails/authentication/templates/app/models/session.rb.tt +3 -0
- data/lib/rails/generators/rails/authentication/templates/app/models/user.rb.tt +6 -0
- data/lib/rails/generators/rails/authentication/templates/app/views/passwords_mailer/reset.html.erb.tt +4 -0
- data/lib/rails/generators/rails/authentication/templates/app/views/passwords_mailer/reset.text.erb.tt +2 -0
- data/lib/rails/generators/rails/authentication/templates/test/mailers/previews/passwords_mailer_preview.rb.tt +7 -0
- data/lib/rails/generators/rails/credentials/templates/credentials.yml.tt +4 -0
- data/lib/rails/generators/rails/db/system/change/change_generator.rb +1 -1
- data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +10 -3
- data/lib/rails/generators/rails/devcontainer/templates/devcontainer/Dockerfile.tt +1 -1
- data/lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt +1 -1
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +11 -11
- data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/github/ci.yml.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 +3 -3
- data/lib/rails/generators/rails/script/USAGE +18 -0
- data/lib/rails/generators/rails/script/script_generator.rb +18 -0
- data/lib/rails/generators/rails/script/templates/script.rb.tt +3 -0
- data/lib/rails/generators/test_unit/authentication/authentication_generator.rb +14 -0
- data/lib/rails/generators/test_unit/authentication/templates/test/fixtures/users.yml.tt +9 -0
- data/lib/rails/generators/test_unit/authentication/templates/test/models/user_test.rb.tt +7 -0
- data/lib/rails/generators.rb +7 -2
- data/lib/rails/info_controller.rb +10 -2
- data/lib/rails/rack/silence_request.rb +33 -0
- data/lib/rails/rack.rb +1 -0
- data/lib/rails/railtie.rb +13 -13
- data/lib/rails/source_annotation_extractor.rb +31 -14
- data/lib/rails/tasks/statistics.rake +13 -28
- data/lib/rails/templates/rails/info/notes.html.erb +65 -0
- data/lib/rails/test_unit/runner.rb +1 -0
- metadata +44 -23
- data/lib/rails/console/app.rb +0 -8
- data/lib/rails/console/helpers.rb +0 -8
- data/lib/rails/generators/rails/app/templates/app/assets/config/manifest.js.tt +0 -2
- data/lib/rails/generators/rails/app/templates/app/channels/application_cable/channel.rb.tt +0 -4
- data/lib/rails/generators/rails/app/templates/app/channels/application_cable/connection.rb.tt +0 -4
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt +0 -70
- data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +0 -13
- data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +0 -13
- data/lib/rails/generators/rails/plugin/templates/rails/dummy_manifest.js.tt +0 -10
- data/lib/rails/generators/rails/plugin/templates/rails/engine_manifest.js.tt +0 -6
- data/lib/rails/generators/rails/plugin/templates/rails/javascripts.js.tt +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48dcbad64d0cf8be785e5a5a80d210e4f0c77ab14abb4b623c3631607e304c0e
|
4
|
+
data.tar.gz: afe11b82be536134605bbd67230361f11d547108f3e6fc32c66462922038d9c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3467d3b3d227a967abf2aae1399900f6fdccba995e139e5d5efd9ba0eaa694e60909122de013fd8670d4c757fb5d294e3b4e8c257e50632c686e1155185521cc
|
7
|
+
data.tar.gz: 16972421f0101f97d3425a105507e886d5d588a48539ba6a4c32af7675281653268bd6b47df8a7370d5837b106f0a832bc35f54dcfdd1f5d12c1bb7408ba8dd1
|
data/CHANGELOG.md
CHANGED
@@ -1,366 +1,210 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 8.0.0.rc1 (October 19, 2024) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* Remove deprecated support to extend Rails console through `Rails::ConsoleMethods`.
|
4
4
|
|
5
|
+
*Rafael Mendonça França*
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
* Fix `rails console` for application with non default application constant.
|
9
|
-
|
10
|
-
The wrongly assumed the Rails application would be named `AppNamespace::Application`,
|
11
|
-
which is the default but not an obligation.
|
12
|
-
|
13
|
-
*Jean Boussier*
|
14
|
-
|
15
|
-
* Fix the default Dockerfile to include the full sqlite3 package.
|
16
|
-
|
17
|
-
Prior to this it only included `libsqlite3`, so it wasn't enough to
|
18
|
-
run `rails dbconsole`.
|
19
|
-
|
20
|
-
*Jerome Dalbert*
|
21
|
-
|
22
|
-
* Don't update public directory during `app:update` command for API-only Applications.
|
23
|
-
|
24
|
-
*y-yagi*
|
25
|
-
|
26
|
-
* Don't add bin/brakeman if brakeman is not in bundle when upgrading an application.
|
27
|
-
|
28
|
-
*Etienne Barrié*
|
29
|
-
|
30
|
-
* Remove PWA views and routes if its an API only project.
|
31
|
-
|
32
|
-
*Jean Boussier*
|
33
|
-
|
34
|
-
* Simplify generated Puma configuration
|
35
|
-
|
36
|
-
*DHH*, *Rafael Mendonça França*
|
37
|
-
|
38
|
-
|
39
|
-
## Rails 7.2.0 (August 09, 2024) ##
|
40
|
-
|
41
|
-
* The new `bin/rails boot` command boots the application and exits. Supports the
|
42
|
-
standard `-e/--environment` options.
|
43
|
-
|
44
|
-
*Xavier Noria*
|
45
|
-
|
46
|
-
* Create a Dev Container Generator that generates a Dev Container setup based on the current configuration
|
47
|
-
of the application. Usage:
|
48
|
-
|
49
|
-
`bin/rails devcontainer`
|
50
|
-
|
51
|
-
*Andrew Novoselac*
|
52
|
-
|
53
|
-
* Add Rubocop and GitHub Actions to plugin generator.
|
54
|
-
This can be skipped using --skip-rubocop and --skip-ci.
|
55
|
-
|
56
|
-
*Chris Oliver*
|
57
|
-
|
58
|
-
* Remove support for `oracle`, `sqlserver` and JRuby specific database adapters from the
|
59
|
-
`rails new` and `rails db:system:change` commands.
|
60
|
-
|
61
|
-
The supported options are `sqlite3`, `mysql`, `postgresql` and `trilogy`.
|
62
|
-
|
63
|
-
*Andrew Novoselac*
|
64
|
-
|
65
|
-
* Add options to `bin/rails app:update`.
|
66
|
-
|
67
|
-
`bin/rails app:update` now supports the same generic options that generators do:
|
68
|
-
|
69
|
-
* `--force`: Accept all changes to existing files
|
70
|
-
* `--skip`: Refuse all changes to existing files
|
71
|
-
* `--pretend`: Don't make any changes
|
72
|
-
* `--quiet`: Don't output all changes made
|
73
|
-
|
74
|
-
*Étienne Barrié*
|
75
|
-
|
76
|
-
* Implement Rails console commands and helpers with IRB v1.13's extension APIs.
|
77
|
-
|
78
|
-
Rails console users will now see `helper`, `controller`, `new_session`, and `app` under
|
79
|
-
IRB help message's `Helper methods` category. And `reload!` command will be displayed under
|
80
|
-
the new `Rails console` commands category.
|
81
|
-
|
82
|
-
Prior to this change, Rails console's commands and helper methods are added through IRB's
|
83
|
-
private components and don't show up in its help message, which led to poor discoverability.
|
84
|
-
|
85
|
-
*Stan Lo*
|
86
|
-
|
87
|
-
* Remove deprecated `Rails::Generators::Testing::Behaviour`.
|
7
|
+
* Remove deprecated file `rails/console/helpers`.
|
88
8
|
|
89
9
|
*Rafael Mendonça França*
|
90
10
|
|
91
|
-
* Remove deprecated `
|
11
|
+
* Remove deprecated file `rails/console/app`.
|
92
12
|
|
93
13
|
*Rafael Mendonça França*
|
94
14
|
|
95
|
-
* Remove deprecated `
|
15
|
+
* Remove deprecated `config.read_encrypted_secrets`.
|
96
16
|
|
97
17
|
*Rafael Mendonça França*
|
98
18
|
|
99
|
-
*
|
19
|
+
* Add Kamal support for devcontainers
|
100
20
|
|
101
|
-
|
21
|
+
Previously generated devcontainer could not use docker and therefore Kamal.
|
102
22
|
|
103
|
-
*
|
23
|
+
*Joé Dupuis*
|
104
24
|
|
105
|
-
Requiring `debug` gem directly automatically activates it, which could introduce
|
106
|
-
additional overhead and memory usage even without entering a debugging session.
|
107
25
|
|
108
|
-
|
109
|
-
to breakpoint methods like `debugger` or `binding.break`, but the debugger won't be
|
110
|
-
activated until a breakpoint is hit.
|
26
|
+
## Rails 8.0.0.beta1 (September 26, 2024) ##
|
111
27
|
|
112
|
-
|
28
|
+
* Exit `rails g` with code 1 if generator could not be found.
|
113
29
|
|
114
|
-
|
115
|
-
`--skip-test` option.
|
30
|
+
Previously `rails g` returned 0, which would make it harder to catch typos in scripts calling `rails g`.
|
116
31
|
|
117
|
-
*
|
32
|
+
*Christopher Özbek*
|
118
33
|
|
119
|
-
*
|
34
|
+
* Remove `require_*` statements from application.css to align with the transition from Sprockets to Propshaft.
|
120
35
|
|
121
|
-
|
36
|
+
With Propshaft as the default asset pipeline in Rails 8, the require_tree and require_self clauses in application.css are no longer necessary, as they were specific to Sprockets. Additionally, the comment has been updated to clarify that CSS precedence now follows standard cascading order without automatic prioritization by the asset pipeline.
|
122
37
|
|
123
|
-
*
|
38
|
+
*Eduardo Alencar*
|
124
39
|
|
125
|
-
|
126
|
-
being Rails::HTML4::Sanitizer when it should be set to Rails::HTML5::Sanitizer.
|
40
|
+
* Do not include redis by default in generated Dev Containers.
|
127
41
|
|
128
|
-
|
42
|
+
Now that applications use the Solid Queue and Solid Cache gems by default, we do not need to include redis
|
43
|
+
in the Dev Container. We will only include redis if `--skip-solid` is used when generating an app that uses
|
44
|
+
Active Job or Action Cable.
|
129
45
|
|
130
|
-
|
46
|
+
When generating a Dev Container for an existing app, we will not include redis if either of the solid gems
|
47
|
+
are in use.
|
131
48
|
|
132
|
-
|
133
|
-
if a mailer included a url built with a `*_path` helper.
|
49
|
+
*Andrew Novoselac*
|
134
50
|
|
135
|
-
|
51
|
+
* Use [Solid Cable](https://github.com/rails/solid_cable) as the default Action Cable adapter in production, configured as a separate queue database in config/database.yml. It keeps messages in a table and continuously polls for updates. This makes it possible to drop the common dependency on Redis, if it isn't needed for any other purpose. Despite polling, the performance of Solid Cable is comparable to Redis in most situations. And in all circumstances, it makes it easier to deploy Rails when Redis is no longer a required dependency for Action Cable functionality.
|
136
52
|
|
137
|
-
*
|
53
|
+
*DHH*
|
138
54
|
|
139
|
-
|
55
|
+
* Use [Solid Queue](https://github.com/rails/solid_queue) as the default Active Job backend in production, configured as a separate queue database in config/database.yml. In a single-server deployment, it'll run as a Puma plugin. This is configured in `config/deploy.yml` and can easily be changed to use a dedicated jobs machine.
|
140
56
|
|
141
|
-
|
142
|
-
assert_initializer "mail_interceptors.rb"
|
143
|
-
```
|
57
|
+
*DHH*
|
144
58
|
|
145
|
-
|
59
|
+
* Use [Solid Cache](https://github.com/rails/solid_cache) as the default Rails.cache backend in production, configured as a separate cache database in config/database.yml.
|
146
60
|
|
147
|
-
*
|
61
|
+
*DHH*
|
62
|
+
|
63
|
+
* Add Rails::Rack::SilenceRequest middleware and use it via `config.silence_healthcheck_path = path`
|
64
|
+
to silence requests to "/up". This prevents the Kamal-required health checks from clogging up
|
65
|
+
the production logs.
|
148
66
|
|
149
|
-
|
67
|
+
*DHH*
|
150
68
|
|
151
|
-
|
152
|
-
- A redis container for Kredis, ActionCable etc.
|
153
|
-
- A database (SQLite, Postgres, MySQL or MariaDB)
|
154
|
-
- A Headless chrome container for system tests
|
155
|
-
- Active Storage configured to use the local disk and with preview features working
|
69
|
+
* Introduce `mariadb-mysql` and `mariadb-trilogy` database options for `rails new`
|
156
70
|
|
157
|
-
|
71
|
+
When used with the `--devcontainer` flag, these options will use `mariadb` as the database for the
|
72
|
+
Dev Container. The original `mysql` and `trilogy` options will use `mysql`. Users who are not
|
73
|
+
generating a Dev Container do not need to use the new options.
|
158
74
|
|
159
|
-
|
75
|
+
*Andrew Novoselac*
|
160
76
|
|
161
|
-
|
77
|
+
* Deprecate `::STATS_DIRECTORIES`.
|
162
78
|
|
163
|
-
|
79
|
+
The global constant `STATS_DIRECTORIES` has been deprecated in favor of
|
80
|
+
`Rails::CodeStatistics.register_directory`.
|
164
81
|
|
165
|
-
|
82
|
+
Add extra directories with `Rails::CodeStatistics.register_directory(label, path)`:
|
166
83
|
|
167
84
|
```ruby
|
168
|
-
|
169
|
-
|
170
|
-
end
|
85
|
+
require "rails/code_statistics"
|
86
|
+
Rails::CodeStatistics.register_directory('My Directory', 'path/to/dir')
|
171
87
|
```
|
172
88
|
|
173
|
-
*
|
89
|
+
*Petrik de Heus*
|
174
90
|
|
175
|
-
*
|
91
|
+
* Enable query log tags by default on development env
|
176
92
|
|
177
|
-
|
93
|
+
This can be used to trace troublesome SQL statements back to the application
|
94
|
+
code that generated these statements. It is also useful when using multiple
|
95
|
+
databases because the query logs can identify which database is being used.
|
178
96
|
|
179
|
-
*
|
97
|
+
*Matheus Richard*
|
180
98
|
|
181
|
-
|
99
|
+
* Defer route drawing to the first request, or when url_helpers are called
|
182
100
|
|
183
|
-
|
101
|
+
Executes the first routes reload in middleware, or when a route set's
|
102
|
+
url_helpers receives a route call / asked if it responds to a route.
|
103
|
+
Previously, this was executed unconditionally on boot, which can
|
104
|
+
slow down boot time unnecessarily for larger apps with lots of routes.
|
184
105
|
|
185
|
-
|
106
|
+
Environments like production that have `config.eager_load = true` will
|
107
|
+
continue to eagerly load routes on boot.
|
186
108
|
|
187
|
-
*
|
188
|
-
rails new generator command. Update ARGVScrubber to ignore text after `#` symbols.
|
109
|
+
*Gannon McGibbon*
|
189
110
|
|
190
|
-
|
111
|
+
* Generate form helpers to use `textarea*` methods instead of `text_area*` methods
|
191
112
|
|
192
|
-
*
|
113
|
+
*Sean Doyle*
|
193
114
|
|
194
|
-
|
115
|
+
* Add authentication generator to give a basic start to an authentication system using database-tracked sessions and password reset.
|
195
116
|
|
196
|
-
|
117
|
+
Generate with...
|
197
118
|
|
198
|
-
```
|
199
|
-
|
200
|
-
my-app(test)> # for RAILS_ENV=test
|
201
|
-
my-app(prod)> # for RAILS_ENV=production
|
202
|
-
my-app(my_env)> # for RAILS_ENV=my_env
|
119
|
+
```
|
120
|
+
bin/rails generate authentication
|
203
121
|
```
|
204
122
|
|
205
|
-
|
206
|
-
For example, `MyApp` will displayed as `my-app` in the prompt.
|
207
|
-
|
208
|
-
Additionally, the environment name will be colorized when the environment is
|
209
|
-
`development` (blue), `test` (blue), or `production` (red), if your
|
210
|
-
terminal supports it.
|
211
|
-
|
212
|
-
*Stan Lo*
|
213
|
-
|
214
|
-
* Ensure `autoload_paths`, `autoload_once_paths`, `eager_load_paths`, and
|
215
|
-
`load_paths` only have directories when initialized from engine defaults.
|
216
|
-
|
217
|
-
Previously, files under the `app` directory could end up there too.
|
218
|
-
|
219
|
-
*Takumasa Ochi*
|
220
|
-
|
221
|
-
* Prevent unnecessary application reloads in development.
|
222
|
-
|
223
|
-
Previously, some files outside autoload paths triggered unnecessary reloads.
|
224
|
-
With this fix, application reloads according to `Rails.autoloaders.main.dirs`,
|
225
|
-
thereby preventing unnecessary reloads.
|
226
|
-
|
227
|
-
*Takumasa Ochi*
|
228
|
-
|
229
|
-
* Use `oven-sh/setup-bun` in GitHub CI when generating an app with Bun.
|
230
|
-
|
231
|
-
*TangRufus*
|
232
|
-
|
233
|
-
* Disable `pidfile` generation in the `production` environment.
|
123
|
+
Generated files:
|
234
124
|
|
235
|
-
|
125
|
+
```
|
126
|
+
app/models/current.rb
|
127
|
+
app/models/user.rb
|
128
|
+
app/models/session.rb
|
129
|
+
app/controllers/sessions_controller.rb
|
130
|
+
app/controllers/passwords_controller.rb
|
131
|
+
app/mailers/passwords_mailer.rb
|
132
|
+
app/views/sessions/new.html.erb
|
133
|
+
app/views/passwords/new.html.erb
|
134
|
+
app/views/passwords/edit.html.erb
|
135
|
+
app/views/passwords_mailer/reset.html.erb
|
136
|
+
app/views/passwords_mailer/reset.text.erb
|
137
|
+
db/migrate/xxxxxxx_create_users.rb
|
138
|
+
db/migrate/xxxxxxx_create_sessions.rb
|
139
|
+
test/mailers/previews/passwords_mailer_preview.rb
|
140
|
+
```
|
236
141
|
|
237
|
-
*
|
238
|
-
the `development` environment.
|
142
|
+
*DHH*
|
239
143
|
|
240
|
-
*Adrian Marin*
|
241
144
|
|
242
|
-
*
|
145
|
+
* Add not-null type modifier to migration attributes.
|
243
146
|
|
244
|
-
|
147
|
+
Generating with...
|
245
148
|
|
246
|
-
```
|
247
|
-
|
149
|
+
```
|
150
|
+
bin/rails generate migration CreateUsers email_address:string!:uniq password_digest:string!
|
248
151
|
```
|
249
152
|
|
250
|
-
|
251
|
-
|
252
|
-
* Raise `ArgumentError` when reading `config.x.something` with arguments:
|
153
|
+
Produces:
|
253
154
|
|
254
155
|
```ruby
|
255
|
-
|
156
|
+
class CreateUsers < ActiveRecord::Migration[8.0]
|
157
|
+
def change
|
158
|
+
create_table :users do |t|
|
159
|
+
t.string :email_address, null: false
|
160
|
+
t.string :password_digest, null: false
|
161
|
+
|
162
|
+
t.timestamps
|
163
|
+
end
|
164
|
+
add_index :users, :email_address, unique: true
|
165
|
+
end
|
166
|
+
end
|
256
167
|
```
|
257
168
|
|
258
|
-
*Sean Doyle*
|
259
|
-
|
260
|
-
* 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.
|
261
|
-
|
262
|
-
*DHH*
|
263
|
-
|
264
|
-
* Updated system tests to now use headless Chrome by default for the new applications.
|
265
|
-
|
266
|
-
*DHH*
|
267
|
-
|
268
|
-
* Add GitHub CI files for Dependabot, Brakeman, RuboCop, and running tests by default. Can be skipped with `--skip-ci`.
|
269
|
-
|
270
169
|
*DHH*
|
271
170
|
|
272
|
-
* Add
|
273
|
-
|
274
|
-
*vipulnsward*
|
275
|
-
|
276
|
-
* Add RuboCop with rules from `rubocop-rails-omakase` by default. Skip with `--skip-rubocop`.
|
277
|
-
|
278
|
-
*DHH* and *zzak*
|
279
|
-
|
280
|
-
* Use `bin/rails runner --skip-executor` to not wrap the runner script with an
|
281
|
-
Executor.
|
282
|
-
|
283
|
-
*Ben Sheldon*
|
171
|
+
* Add a `script` folder to applications, and a scripts generator.
|
284
172
|
|
285
|
-
|
173
|
+
The new `script` folder is meant to hold one-off or general purpose scripts,
|
174
|
+
such as data migration scripts, cleanup scripts, etc.
|
286
175
|
|
287
|
-
|
288
|
-
Active Record table name prefix configuration.
|
289
|
-
|
290
|
-
*Chedli Bourguiba*
|
291
|
-
|
292
|
-
* Fix running `db:system:change` when the app has no Dockerfile.
|
293
|
-
|
294
|
-
*Hartley McGuire*
|
295
|
-
|
296
|
-
* In Action Mailer previews, list inline attachments separately from normal
|
297
|
-
attachments.
|
298
|
-
|
299
|
-
For example, attachments that were previously listed like
|
300
|
-
|
301
|
-
> Attachments: logo.png file1.pdf file2.pdf
|
302
|
-
|
303
|
-
will now be listed like
|
304
|
-
|
305
|
-
> Attachments: file1.pdf file2.pdf (Inline: logo.png)
|
306
|
-
|
307
|
-
*Christian Schmidt* and *Jonathan Hefner*
|
308
|
-
|
309
|
-
* In mailer preview, only show SMTP-To if it differs from the union of To, Cc and Bcc.
|
310
|
-
|
311
|
-
*Christian Schmidt*
|
312
|
-
|
313
|
-
* Enable YJIT by default on new applications running Ruby 3.3+.
|
314
|
-
|
315
|
-
This can be disabled by setting `Rails.application.config.yjit = false`
|
316
|
-
|
317
|
-
*Jean Boussier*, *Rafael Mendonça França*
|
318
|
-
|
319
|
-
* In Action Mailer previews, show date from message `Date` header if present.
|
320
|
-
|
321
|
-
*Sampat Badhe*
|
322
|
-
|
323
|
-
* Exit with non-zero status when the migration generator fails.
|
324
|
-
|
325
|
-
*Katsuhiko YOSHIDA*
|
326
|
-
|
327
|
-
* Use numeric UID and GID in Dockerfile template.
|
328
|
-
|
329
|
-
The Dockerfile generated by `rails new` sets the default user and group
|
330
|
-
by name instead of UID:GID. This can cause the following error in Kubernetes:
|
176
|
+
A new script generator allows you to create such scripts:
|
331
177
|
|
332
178
|
```
|
333
|
-
|
179
|
+
bin/rails generate script my_script
|
180
|
+
bin/rails generate script data/backfill
|
334
181
|
```
|
335
182
|
|
336
|
-
|
337
|
-
|
338
|
-
*Ivan Fedotov*
|
183
|
+
You can run the generated script using:
|
339
184
|
|
340
|
-
|
185
|
+
```
|
186
|
+
bundle exec ruby script/my_script.rb
|
187
|
+
bundle exec ruby script/data/backfill.rb
|
188
|
+
```
|
341
189
|
|
342
|
-
|
343
|
-
for `rails new` take different arguments. This change validates them.
|
190
|
+
*Jerome Dalbert*, *Haroon Ahmed*
|
344
191
|
|
345
|
-
|
192
|
+
* Deprecate `bin/rake stats` in favor of `bin/rails stats`.
|
346
193
|
|
347
|
-
*
|
194
|
+
*Juan Vásquez*
|
348
195
|
|
349
|
-
|
350
|
-
generator tests, we add the ability to conditionally print `$stdout`
|
351
|
-
instead of capturing it.
|
196
|
+
* Add internal page `/rails/info/notes`, that displays the same information as `bin/rails notes`.
|
352
197
|
|
353
|
-
|
198
|
+
*Deepak Mahakale*
|
354
199
|
|
355
|
-
|
356
|
-
|
357
|
-
```
|
200
|
+
* Add Rubocop and GitHub Actions to plugin generator.
|
201
|
+
This can be skipped using --skip-rubocop and --skip-ci.
|
358
202
|
|
359
|
-
*
|
203
|
+
*Chris Oliver*
|
360
204
|
|
361
|
-
*
|
362
|
-
|
205
|
+
* Use Kamal for deployment by default, which includes generating a Rails-specific config/deploy.yml.
|
206
|
+
This can be skipped using --skip-kamal. See more: https://kamal-deploy.org/
|
363
207
|
|
364
|
-
*
|
208
|
+
*DHH*
|
365
209
|
|
366
|
-
Please check [7-
|
210
|
+
Please check [7-2-stable](https://github.com/rails/rails/blob/7-2-stable/railties/CHANGELOG.md) for previous changes.
|
@@ -110,7 +110,7 @@ module Minitest
|
|
110
110
|
# minitest-reporters, maxitest, and others.
|
111
111
|
def self.plugin_rails_init(options)
|
112
112
|
# Don't mess with Minitest unless RAILS_ENV is set
|
113
|
-
return unless ENV["RAILS_ENV"]
|
113
|
+
return unless ENV["RAILS_ENV"] || ENV["RAILS_MINITEST_PLUGIN"]
|
114
114
|
|
115
115
|
unless options[:full_backtrace]
|
116
116
|
# Plugin can run without Rails loaded, check before filtering.
|
@@ -15,7 +15,7 @@ module Rails
|
|
15
15
|
:cache_classes, :cache_store, :consider_all_requests_local, :console,
|
16
16
|
:eager_load, :exceptions_app, :file_watcher, :filter_parameters, :precompile_filter_parameters,
|
17
17
|
:force_ssl, :helpers_paths, :hosts, :host_authorization, :logger, :log_formatter,
|
18
|
-
:log_tags, :railties_order, :relative_url_root,
|
18
|
+
:log_tags, :silence_healthcheck_path, :railties_order, :relative_url_root,
|
19
19
|
:ssl_options, :public_file_server,
|
20
20
|
:session_options, :time_zone, :reload_classes_only_on_change,
|
21
21
|
:beginning_of_week, :filter_redirect, :x,
|
@@ -62,6 +62,7 @@ module Rails
|
|
62
62
|
@exceptions_app = nil
|
63
63
|
@autoflush_log = true
|
64
64
|
@log_formatter = ActiveSupport::Logger::SimpleFormatter.new
|
65
|
+
@silence_healthcheck_path = nil
|
65
66
|
@eager_load = nil
|
66
67
|
@secret_key_base = nil
|
67
68
|
@api_only = false
|
@@ -114,7 +115,9 @@ module Rails
|
|
114
115
|
action_controller.forgery_protection_origin_check = true
|
115
116
|
end
|
116
117
|
|
117
|
-
|
118
|
+
if respond_to?(:active_support)
|
119
|
+
active_support.to_time_preserves_timezone = :offset
|
120
|
+
end
|
118
121
|
|
119
122
|
if respond_to?(:active_record)
|
120
123
|
active_record.belongs_to_required_by_default = true
|
@@ -323,10 +326,6 @@ module Rails
|
|
323
326
|
|
324
327
|
self.yjit = true
|
325
328
|
|
326
|
-
if respond_to?(:active_job)
|
327
|
-
active_job.enqueue_after_transaction_commit = :default
|
328
|
-
end
|
329
|
-
|
330
329
|
if respond_to?(:active_storage)
|
331
330
|
active_storage.web_image_content_types = %w( image/png image/jpeg image/gif image/webp )
|
332
331
|
end
|
@@ -335,6 +334,16 @@ module Rails
|
|
335
334
|
active_record.postgresql_adapter_decode_dates = true
|
336
335
|
active_record.validate_migration_timestamps = true
|
337
336
|
end
|
337
|
+
when "8.0"
|
338
|
+
load_defaults "7.2"
|
339
|
+
|
340
|
+
if respond_to?(:active_support)
|
341
|
+
active_support.to_time_preserves_timezone = :zone
|
342
|
+
end
|
343
|
+
|
344
|
+
if respond_to?(:action_dispatch)
|
345
|
+
action_dispatch.strict_freshness = true
|
346
|
+
end
|
338
347
|
else
|
339
348
|
raise "Unknown version #{target_version.to_s.inspect}"
|
340
349
|
end
|
@@ -354,14 +363,6 @@ module Rails
|
|
354
363
|
self.cache_classes = !value
|
355
364
|
end
|
356
365
|
|
357
|
-
def read_encrypted_secrets
|
358
|
-
Rails.deprecator.warn("'config.read_encrypted_secrets' is deprecated and will be removed in Rails 8.0.")
|
359
|
-
end
|
360
|
-
|
361
|
-
def read_encrypted_secrets=(value)
|
362
|
-
Rails.deprecator.warn("'config.read_encrypted_secrets=' is deprecated and will be removed in Rails 8.0.")
|
363
|
-
end
|
364
|
-
|
365
366
|
def encoding=(value)
|
366
367
|
@encoding = value
|
367
368
|
silence_warnings do
|
@@ -54,6 +54,10 @@ module Rails
|
|
54
54
|
middleware.use ::ActionDispatch::RequestId, header: config.action_dispatch.request_id_header
|
55
55
|
middleware.use ::ActionDispatch::RemoteIp, config.action_dispatch.ip_spoofing_check, config.action_dispatch.trusted_proxies
|
56
56
|
|
57
|
+
if path = config.silence_healthcheck_path
|
58
|
+
middleware.use ::Rails::Rack::SilenceRequest, path: path
|
59
|
+
end
|
60
|
+
|
57
61
|
middleware.use ::Rails::Rack::Logger, config.log_tags
|
58
62
|
middleware.use ::ActionDispatch::ShowExceptions, show_exceptions_app
|
59
63
|
middleware.use ::ActionDispatch::DebugExceptions, app, config.debug_exception_response_format
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "set"
|
4
3
|
require "active_support/core_ext/string/inflections"
|
5
4
|
require "active_support/core_ext/array/conversions"
|
6
5
|
require "active_support/descendants_tracker"
|
@@ -143,6 +142,7 @@ module Rails
|
|
143
142
|
app.routes.prepend do
|
144
143
|
get "/rails/info/properties" => "rails/info#properties", internal: true
|
145
144
|
get "/rails/info/routes" => "rails/info#routes", internal: true
|
145
|
+
get "/rails/info/notes" => "rails/info#notes", internal: true
|
146
146
|
get "/rails/info" => "rails/info#index", internal: true
|
147
147
|
end
|
148
148
|
|
@@ -159,7 +159,6 @@ module Rails
|
|
159
159
|
initializer :set_routes_reloader_hook do |app|
|
160
160
|
reloader = routes_reloader
|
161
161
|
reloader.eager_load = app.config.eager_load
|
162
|
-
reloader.execute
|
163
162
|
reloaders << reloader
|
164
163
|
|
165
164
|
app.reloader.to_run do
|
@@ -177,7 +176,7 @@ module Rails
|
|
177
176
|
ActiveSupport.run_load_hooks(:after_routes_loaded, self)
|
178
177
|
end
|
179
178
|
|
180
|
-
|
179
|
+
reloader.execute_unless_loaded if !app.routes.is_a?(Engine::LazyRouteSet) || app.config.eager_load
|
181
180
|
end
|
182
181
|
|
183
182
|
# Set clearing dependencies after the finisher hook to ensure paths
|