railties 7.2.3.1 → 8.0.5.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.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +169 -257
  3. data/lib/minitest/rails_plugin.rb +8 -1
  4. data/lib/rails/application/bootstrap.rb +0 -1
  5. data/lib/rails/application/configuration.rb +17 -14
  6. data/lib/rails/application/default_middleware_stack.rb +4 -0
  7. data/lib/rails/application/finisher.rb +2 -3
  8. data/lib/rails/application/routes_reloader.rb +17 -3
  9. data/lib/rails/application.rb +10 -1
  10. data/lib/rails/application_controller.rb +2 -0
  11. data/lib/rails/backtrace_cleaner.rb +2 -2
  12. data/lib/rails/code_statistics.rb +128 -86
  13. data/lib/rails/code_statistics_calculator.rb +78 -76
  14. data/lib/rails/command/helpers/editor.rb +1 -1
  15. data/lib/rails/command.rb +0 -6
  16. data/lib/rails/commands/app/update_command.rb +5 -9
  17. data/lib/rails/commands/console/irb_console.rb +3 -6
  18. data/lib/rails/commands/credentials/USAGE +4 -4
  19. data/lib/rails/commands/credentials/credentials_command.rb +5 -1
  20. data/lib/rails/commands/dev/dev_command.rb +1 -1
  21. data/lib/rails/commands/devcontainer/devcontainer_command.rb +2 -1
  22. data/lib/rails/commands/stats/stats_command.rb +19 -0
  23. data/lib/rails/console/methods.rb +5 -21
  24. data/lib/rails/dev_caching.rb +2 -2
  25. data/lib/rails/engine/configuration.rb +3 -1
  26. data/lib/rails/engine/lazy_route_set.rb +111 -0
  27. data/lib/rails/engine.rb +10 -6
  28. data/lib/rails/gem_version.rb +3 -3
  29. data/lib/rails/generators/actions.rb +3 -3
  30. data/lib/rails/generators/app_base.rb +76 -56
  31. data/lib/rails/generators/base.rb +0 -4
  32. data/lib/rails/generators/bundle_helper.rb +34 -0
  33. data/lib/rails/generators/database.rb +101 -67
  34. data/lib/rails/generators/erb/authentication/authentication_generator.rb +15 -0
  35. data/lib/rails/generators/erb/authentication/templates/app/views/passwords/edit.html.erb +9 -0
  36. data/lib/rails/generators/erb/authentication/templates/app/views/passwords/new.html.erb +8 -0
  37. data/lib/rails/generators/erb/authentication/templates/app/views/sessions/new.html.erb +11 -0
  38. data/lib/rails/generators/generated_attribute.rb +16 -11
  39. data/lib/rails/generators/rails/app/app_generator.rb +30 -30
  40. data/lib/rails/generators/rails/app/templates/Dockerfile.tt +23 -6
  41. data/lib/rails/generators/rails/app/templates/Gemfile.tt +27 -12
  42. data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css.tt +6 -11
  43. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +10 -3
  44. data/lib/rails/generators/rails/app/templates/bin/dev.tt +1 -0
  45. data/lib/rails/generators/rails/app/templates/bin/setup.tt +5 -8
  46. data/lib/rails/generators/rails/app/templates/bin/thrust.tt +4 -0
  47. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +24 -1
  48. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +23 -0
  49. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +50 -0
  50. data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +30 -5
  51. data/lib/rails/generators/rails/app/templates/config/deploy.yml.tt +128 -0
  52. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +12 -23
  53. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +31 -51
  54. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +5 -19
  55. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +0 -7
  56. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +1 -1
  57. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_8_0.rb.tt +30 -0
  58. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +11 -2
  59. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +3 -3
  60. data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +4 -3
  61. data/lib/rails/generators/rails/app/templates/dockerignore.tt +7 -2
  62. data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +12 -6
  63. data/lib/rails/generators/rails/app/templates/gitignore.tt +1 -2
  64. data/lib/rails/generators/rails/app/templates/kamal-secrets.tt +17 -0
  65. data/lib/rails/generators/rails/app/templates/public/400.html +114 -0
  66. data/lib/rails/generators/rails/app/templates/public/404.html +113 -66
  67. data/lib/rails/generators/rails/app/templates/public/406-unsupported-browser.html +113 -65
  68. data/lib/rails/generators/rails/app/templates/public/422.html +113 -66
  69. data/lib/rails/generators/rails/app/templates/public/500.html +113 -65
  70. data/lib/rails/generators/rails/app/templates/public/icon.png +0 -0
  71. data/lib/rails/generators/rails/app/templates/public/icon.svg +2 -2
  72. data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -1
  73. data/lib/rails/generators/rails/authentication/USAGE +6 -0
  74. data/lib/rails/generators/rails/authentication/authentication_generator.rb +60 -0
  75. data/lib/rails/generators/rails/authentication/templates/app/channels/application_cable/connection.rb.tt +16 -0
  76. data/lib/rails/generators/rails/authentication/templates/app/controllers/concerns/authentication.rb.tt +52 -0
  77. data/lib/rails/generators/rails/authentication/templates/app/controllers/passwords_controller.rb.tt +33 -0
  78. data/lib/rails/generators/rails/authentication/templates/app/controllers/sessions_controller.rb.tt +21 -0
  79. data/lib/rails/generators/rails/authentication/templates/app/mailers/passwords_mailer.rb.tt +6 -0
  80. data/lib/rails/generators/rails/authentication/templates/app/models/current.rb.tt +4 -0
  81. data/lib/rails/generators/rails/authentication/templates/app/models/session.rb.tt +3 -0
  82. data/lib/rails/generators/rails/authentication/templates/app/models/user.rb.tt +6 -0
  83. data/lib/rails/generators/rails/authentication/templates/app/views/passwords_mailer/reset.html.erb.tt +4 -0
  84. data/lib/rails/generators/rails/authentication/templates/app/views/passwords_mailer/reset.text.erb.tt +2 -0
  85. data/lib/rails/generators/rails/credentials/templates/credentials.yml.tt +4 -0
  86. data/lib/rails/generators/rails/db/system/change/change_generator.rb +1 -1
  87. data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +12 -2
  88. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/Dockerfile.tt +1 -1
  89. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt +5 -5
  90. data/lib/rails/generators/rails/plugin/plugin_generator.rb +7 -9
  91. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +1 -1
  92. data/lib/rails/generators/rails/plugin/templates/github/ci.yml.tt +3 -3
  93. data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +2 -2
  94. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +3 -3
  95. data/lib/rails/generators/rails/script/USAGE +18 -0
  96. data/lib/rails/generators/rails/script/script_generator.rb +18 -0
  97. data/lib/rails/generators/rails/script/templates/script.rb.tt +3 -0
  98. data/lib/rails/generators/test_unit/authentication/authentication_generator.rb +18 -0
  99. data/lib/rails/generators/test_unit/authentication/templates/test/fixtures/users.yml.tt +9 -0
  100. data/lib/rails/generators/test_unit/authentication/templates/test/mailers/previews/passwords_mailer_preview.rb.tt +7 -0
  101. data/lib/rails/generators/test_unit/authentication/templates/test/models/user_test.rb.tt +7 -0
  102. data/lib/rails/generators.rb +1 -0
  103. data/lib/rails/health_controller.rb +2 -0
  104. data/lib/rails/info.rb +2 -1
  105. data/lib/rails/info_controller.rb +10 -4
  106. data/lib/rails/rack/silence_request.rb +33 -0
  107. data/lib/rails/rack.rb +1 -0
  108. data/lib/rails/source_annotation_extractor.rb +37 -16
  109. data/lib/rails/tasks/statistics.rake +13 -28
  110. data/lib/rails/templates/rails/info/notes.html.erb +65 -0
  111. data/lib/rails/templates/rails/mailers/email.html.erb +1 -1
  112. data/lib/rails/test_unit/line_filtering.rb +24 -3
  113. data/lib/rails/test_unit/reporter.rb +8 -4
  114. data/lib/rails/test_unit/runner.rb +1 -0
  115. metadata +46 -37
  116. data/lib/rails/console/app.rb +0 -8
  117. data/lib/rails/console/helpers.rb +0 -8
  118. data/lib/rails/generators/rails/app/templates/app/assets/config/manifest.js.tt +0 -2
  119. data/lib/rails/generators/rails/app/templates/app/channels/application_cable/channel.rb.tt +0 -4
  120. data/lib/rails/generators/rails/app/templates/app/channels/application_cable/connection.rb.tt +0 -4
  121. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt +0 -70
  122. data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +0 -13
  123. data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +0 -13
  124. data/lib/rails/generators/rails/plugin/templates/rails/dummy_manifest.js.tt +0 -10
  125. data/lib/rails/generators/rails/plugin/templates/rails/engine_manifest.js.tt +0 -6
  126. 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: 6901f0b92ef11f501dfc346db6917e4f8c5612cfe69dcf286b2fe34c7984d00d
4
- data.tar.gz: fc0584d1aa4d6a4900ccbaa846eef834deb35a96e253c0fb3abc47e9216f5ffe
3
+ metadata.gz: 8b32ed793155a8579231dee3a419c00d894b22b64ebdbf015f61987298f2fd07
4
+ data.tar.gz: 5b81a0a2f8114fded7ca0f2d9600891c3c4a0376bfe284d12597c54091a522b1
5
5
  SHA512:
6
- metadata.gz: 105b31ef811832df283f6b185b0e2a3277023e949ed32b45bfb64ff99733df720c74b60b83d38679411069a52671f0df1b46add11385219f610c13a9894e2446
7
- data.tar.gz: ef33b6491ada406372baa50d9e1f5ea70e0cae44abca697bea78748610109eca8e91fb68b077c1a5b55e5388f1d7108d78812b4d29da0b8f88143fd93da0f2e3
6
+ metadata.gz: 942dc062d0b95521fcd57d65b0b5cbdac3cc9860ec9ad6beb1036cd1de077075dc75645985cdaaa1e71f674db5e2f6de6ee1652052c3f6a98e9ca8f72a0f486d
7
+ data.tar.gz: 6bb721eff1b04d24febbbca12cbd87bf661201ccc840f38b3b13066ab649017289b3e8c2c19bc45efffe00a62c789191da0ba7313f0f4b4ac64c80bf4f9d0953
data/CHANGELOG.md CHANGED
@@ -1,403 +1,315 @@
1
- ## Rails 7.2.3.1 (March 23, 2026) ##
1
+ ## Rails 8.0.5.1 (July 29, 2026) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 7.2.3 (October 28, 2025) ##
6
+ ## Rails 8.0.5 (March 24, 2026) ##
7
7
 
8
- * Use `secret_key_base` from ENV or credentials when present locally.
8
+ * Fixed the `rails notes` command to properly extract notes in CSS files.
9
9
 
10
- When ENV["SECRET_KEY_BASE"] or
11
- `Rails.application.credentials.secret_key_base` is set for test or
12
- development, it is used for the `Rails.config.secret_key_base`,
13
- instead of generating a `tmp/local_secret.txt` file.
10
+ *David White*
14
11
 
15
- *Petrik de Heus*
12
+ * Fixed the default Dockerfile to properly include the `vendor/` directory during `bundle install`.
13
+
14
+ *Zhong Sheng*
16
15
 
17
16
 
18
- ## Rails 7.2.2.2 (August 13, 2025) ##
17
+ ## Rails 8.0.4.1 (March 23, 2026) ##
19
18
 
20
19
  * No changes.
21
20
 
22
21
 
23
- ## Rails 7.2.2.1 (December 10, 2024) ##
22
+ ## Rails 8.0.4 (October 28, 2025) ##
24
23
 
25
24
  * No changes.
26
25
 
27
26
 
28
- ## Rails 7.2.2 (October 30, 2024) ##
27
+ ## Rails 8.0.3 (September 22, 2025) ##
29
28
 
30
- * No changes.
29
+ * Fix `polymorphic_url` and `polymorphic_path` not working when routes are not loaded.
31
30
 
31
+ *Édouard Chin*
32
32
 
33
- ## Rails 7.2.1.2 (October 23, 2024) ##
33
+ * Fix Rails console to not override user defined IRB_NAME.
34
34
 
35
- * No changes.
35
+ Only change the prompt name if it hasn't been customized in `.irbrc`.
36
+
37
+ *Jarrett Lusso*
36
38
 
37
39
 
38
- ## Rails 7.2.1.1 (October 15, 2024) ##
40
+ ## Rails 8.0.2.1 (August 13, 2025) ##
39
41
 
40
42
  * No changes.
41
43
 
42
44
 
43
- ## Rails 7.2.1 (August 22, 2024) ##
45
+ ## Rails 8.0.2 (March 12, 2025) ##
44
46
 
45
- * Fix `rails console` for application with non default application constant.
47
+ * Fix Rails console to load routes.
46
48
 
47
- The wrongly assumed the Rails application would be named `AppNamespace::Application`,
48
- which is the default but not an obligation.
49
+ Otherwise `*_path` and `*url` methods are missing on the `app` object.
49
50
 
50
- *Jean Boussier*
51
+ *Édouard Chin*
51
52
 
52
- * Fix the default Dockerfile to include the full sqlite3 package.
53
+ * Update `rails new --minimal` option
53
54
 
54
- Prior to this it only included `libsqlite3`, so it wasn't enough to
55
- run `rails dbconsole`.
55
+ Extend the `--minimal` flag to exclude recently added features:
56
+ `skip_brakeman`, `skip_ci`, `skip_docker`, `skip_kamal`, `skip_rubocop`, `skip_solid` and `skip_thruster`.
56
57
 
57
- *Jerome Dalbert*
58
+ *eelcoj*
58
59
 
59
- * Don't update public directory during `app:update` command for API-only Applications.
60
+ * Use `secret_key_base` from ENV or credentials when present locally.
60
61
 
61
- *y-yagi*
62
+ When ENV["SECRET_KEY_BASE"] or
63
+ `Rails.application.credentials.secret_key_base` is set for test or
64
+ development, it is used for the `Rails.config.secret_key_base`,
65
+ instead of generating a `tmp/local_secret.txt` file.
62
66
 
63
- * Don't add bin/brakeman if brakeman is not in bundle when upgrading an application.
67
+ *Petrik de Heus*
64
68
 
65
- *Etienne Barrié*
66
69
 
67
- * Remove PWA views and routes if its an API only project.
70
+ ## Rails 8.0.1 (December 13, 2024) ##
68
71
 
69
- *Jean Boussier*
72
+ * Skip generation system tests related code for CI when `--skip-system-test` is given.
70
73
 
71
- * Simplify generated Puma configuration
74
+ *fatkodima*
72
75
 
73
- *DHH*, *Rafael Mendonça França*
76
+ * Don't add bin/thrust if thruster is not in Gemfile.
74
77
 
78
+ *Étienne Barrié*
75
79
 
76
- ## Rails 7.2.0 (August 09, 2024) ##
80
+ * Don't install a package for system test when applications don't use it.
77
81
 
78
- * The new `bin/rails boot` command boots the application and exits. Supports the
79
- standard `-e/--environment` options.
82
+ *y-yagi*
80
83
 
81
- *Xavier Noria*
82
84
 
83
- * Create a Dev Container Generator that generates a Dev Container setup based on the current configuration
84
- of the application. Usage:
85
+ ## Rails 8.0.0.1 (December 10, 2024) ##
85
86
 
86
- `bin/rails devcontainer`
87
+ * No changes.
87
88
 
88
- *Andrew Novoselac*
89
89
 
90
- * Add Rubocop and GitHub Actions to plugin generator.
91
- This can be skipped using --skip-rubocop and --skip-ci.
90
+ ## Rails 8.0.0 (November 07, 2024) ##
92
91
 
93
- *Chris Oliver*
92
+ * No changes.
94
93
 
95
- * Remove support for `oracle`, `sqlserver` and JRuby specific database adapters from the
96
- `rails new` and `rails db:system:change` commands.
97
94
 
98
- The supported options are `sqlite3`, `mysql`, `postgresql` and `trilogy`.
95
+ ## Rails 8.0.0.rc2 (October 30, 2024) ##
99
96
 
100
- *Andrew Novoselac*
97
+ * Fix incorrect database.yml with `skip_solid`.
101
98
 
102
- * Add options to `bin/rails app:update`.
99
+ *Joé Dupuis*
103
100
 
104
- `bin/rails app:update` now supports the same generic options that generators do:
101
+ * Set `Regexp.timeout` to `1`s by default to improve security over Regexp Denial-of-Service attacks.
105
102
 
106
- * `--force`: Accept all changes to existing files
107
- * `--skip`: Refuse all changes to existing files
108
- * `--pretend`: Don't make any changes
109
- * `--quiet`: Don't output all changes made
110
-
111
- *Étienne Barrié*
103
+ *Rafael Mendonça França*
112
104
 
113
- * Implement Rails console commands and helpers with IRB v1.13's extension APIs.
114
105
 
115
- Rails console users will now see `helper`, `controller`, `new_session`, and `app` under
116
- IRB help message's `Helper methods` category. And `reload!` command will be displayed under
117
- the new `Rails console` commands category.
106
+ ## Rails 8.0.0.rc1 (October 19, 2024) ##
118
107
 
119
- Prior to this change, Rails console's commands and helper methods are added through IRB's
120
- private components and don't show up in its help message, which led to poor discoverability.
108
+ * Remove deprecated support to extend Rails console through `Rails::ConsoleMethods`.
121
109
 
122
- *Stan Lo*
110
+ *Rafael Mendonça França*
123
111
 
124
- * Remove deprecated `Rails::Generators::Testing::Behaviour`.
112
+ * Remove deprecated file `rails/console/helpers`.
125
113
 
126
114
  *Rafael Mendonça França*
127
115
 
128
- * Remove deprecated `find_cmd_and_exec` console helper.
116
+ * Remove deprecated file `rails/console/app`.
129
117
 
130
118
  *Rafael Mendonça França*
131
119
 
132
- * Remove deprecated `Rails.config.enable_dependency_loading`.
120
+ * Remove deprecated `config.read_encrypted_secrets`.
133
121
 
134
122
  *Rafael Mendonça França*
135
123
 
136
- * Remove deprecated `Rails.application.secrets`.
124
+ * Add Kamal support for devcontainers
137
125
 
138
- *Rafael Mendonça França*
126
+ Previously generated devcontainer could not use docker and therefore Kamal.
139
127
 
140
- * Generated Gemfile will include `require: "debug/prelude"` for the `debug` gem.
128
+ *Joé Dupuis*
141
129
 
142
- Requiring `debug` gem directly automatically activates it, which could introduce
143
- additional overhead and memory usage even without entering a debugging session.
144
130
 
145
- By making Bundler require `debug/prelude` instead, developers can keep their access
146
- to breakpoint methods like `debugger` or `binding.break`, but the debugger won't be
147
- activated until a breakpoint is hit.
131
+ ## Rails 8.0.0.beta1 (September 26, 2024) ##
148
132
 
149
- *Stan Lo*
133
+ * Exit `rails g` with code 1 if generator could not be found.
150
134
 
151
- * Skip generating a `test` job in ci.yml when a new application is generated with the
152
- `--skip-test` option.
135
+ Previously `rails g` returned 0, which would make it harder to catch typos in scripts calling `rails g`.
153
136
 
154
- *Steve Polito*
137
+ *Christopher Özbek*
155
138
 
156
- * Update the `.node-version` file conditionally generated for new applications to 20.11.1
139
+ * Remove `require_*` statements from application.css to align with the transition from Sprockets to Propshaft.
157
140
 
158
- *Steve Polito*
141
+ 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.
159
142
 
160
- * Fix sanitizer vendor configuration in 7.1 defaults.
143
+ *Eduardo Alencar*
161
144
 
162
- In apps where rails-html-sanitizer was not eagerly loaded, the sanitizer default could end up
163
- being Rails::HTML4::Sanitizer when it should be set to Rails::HTML5::Sanitizer.
145
+ * Do not include redis by default in generated Dev Containers.
164
146
 
165
- *Mike Dalessio*, *Rafael Mendonça França*
147
+ Now that applications use the Solid Queue and Solid Cache gems by default, we do not need to include redis
148
+ in the Dev Container. We will only include redis if `--skip-solid` is used when generating an app that uses
149
+ Active Job or Action Cable.
166
150
 
167
- * Set `action_mailer.default_url_options` values in `development` and `test`.
151
+ When generating a Dev Container for an existing app, we will not include redis if either of the solid gems
152
+ are in use.
168
153
 
169
- Prior to this commit, new Rails applications would raise `ActionView::Template::Error`
170
- if a mailer included a url built with a `*_path` helper.
154
+ *Andrew Novoselac*
171
155
 
172
- *Steve Polito*
156
+ * 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.
173
157
 
174
- * Introduce `Rails::Generators::Testing::Assertions#assert_initializer`.
158
+ *DHH*
175
159
 
176
- Compliments the existing `initializer` generator action.
160
+ * 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.
177
161
 
178
- ```rb
179
- assert_initializer "mail_interceptors.rb"
180
- ```
162
+ *DHH*
163
+
164
+ * 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.
181
165
 
182
- *Steve Polito*
166
+ *DHH*
183
167
 
184
- * Generate a .devcontainer folder and its contents when creating a new app.
168
+ * Add Rails::Rack::SilenceRequest middleware and use it via `config.silence_healthcheck_path = path`
169
+ to silence requests to "/up". This prevents the Kamal-required health checks from clogging up
170
+ the production logs.
185
171
 
186
- The .devcontainer folder includes everything needed to boot the app and do development in a remote container.
172
+ *DHH*
187
173
 
188
- The container setup includes:
189
- - A redis container for Kredis, ActionCable etc.
190
- - A database (SQLite, Postgres, MySQL or MariaDB)
191
- - A Headless chrome container for system tests
192
- - Active Storage configured to use the local disk and with preview features working
174
+ * Introduce `mariadb-mysql` and `mariadb-trilogy` database options for `rails new`
193
175
 
194
- If any of these options are skipped in the app setup they will not be included in the container configuration.
176
+ When used with the `--devcontainer` flag, these options will use `mariadb` as the database for the
177
+ Dev Container. The original `mysql` and `trilogy` options will use `mysql`. Users who are not
178
+ generating a Dev Container do not need to use the new options.
195
179
 
196
- These files can be skipped using the `--skip-devcontainer` option.
180
+ *Andrew Novoselac*
197
181
 
198
- *Andrew Novoselac & Rafael Mendonça França*
182
+ * Deprecate `::STATS_DIRECTORIES`.
199
183
 
200
- * Introduce `SystemTestCase#served_by` for configuring the System Test application server.
184
+ The global constant `STATS_DIRECTORIES` has been deprecated in favor of
185
+ `Rails::CodeStatistics.register_directory`.
201
186
 
202
- By default this is localhost. This method allows the host and port to be specified manually.
187
+ Add extra directories with `Rails::CodeStatistics.register_directory(label, path)`:
203
188
 
204
189
  ```ruby
205
- class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
206
- served_by host: "testserver", port: 45678
207
- end
190
+ require "rails/code_statistics"
191
+ Rails::CodeStatistics.register_directory('My Directory', 'path/to/dir')
208
192
  ```
209
193
 
210
- *Andrew Novoselac & Rafael Mendonça França*
194
+ *Petrik de Heus*
211
195
 
212
- * `bin/rails test` will no longer load files named `*_test.rb` if they are located in the `fixtures` folder.
196
+ * Enable query log tags by default on development env
213
197
 
214
- *Edouard Chin*
198
+ This can be used to trace troublesome SQL statements back to the application
199
+ code that generated these statements. It is also useful when using multiple
200
+ databases because the query logs can identify which database is being used.
215
201
 
216
- * Ensure logger tags configured with `config.log_tags` are still active in `request.action_dispatch` handlers.
202
+ *Matheus Richard*
217
203
 
218
- *KJ Tsanaktsidis*
204
+ * Defer route drawing to the first request, or when url_helpers are called
219
205
 
220
- * Setup jemalloc in the default Dockerfile for memory optimization.
206
+ Executes the first routes reload in middleware, or when a route set's
207
+ url_helpers receives a route call / asked if it responds to a route.
208
+ Previously, this was executed unconditionally on boot, which can
209
+ slow down boot time unnecessarily for larger apps with lots of routes.
221
210
 
222
- *Matt Almeida*, *Jean Boussier*
211
+ Environments like production that have `config.eager_load = true` will
212
+ continue to eagerly load routes on boot.
223
213
 
224
- * Commented out lines in .railsrc file should not be treated as arguments when using
225
- rails new generator command. Update ARGVScrubber to ignore text after `#` symbols.
214
+ *Gannon McGibbon*
226
215
 
227
- *Willian Tenfen*
216
+ * Generate form helpers to use `textarea*` methods instead of `text_area*` methods
228
217
 
229
- * Skip CSS when generating APIs.
218
+ *Sean Doyle*
230
219
 
231
- *Ruy Rocha*
220
+ * Add authentication generator to give a basic start to an authentication system using database-tracked sessions and password reset.
232
221
 
233
- * Rails console now indicates application name and the current Rails environment:
222
+ Generate with...
234
223
 
235
- ```txt
236
- my-app(dev)> # for RAILS_ENV=development
237
- my-app(test)> # for RAILS_ENV=test
238
- my-app(prod)> # for RAILS_ENV=production
239
- my-app(my_env)> # for RAILS_ENV=my_env
224
+ ```
225
+ bin/rails generate authentication
240
226
  ```
241
227
 
242
- The application name is derived from the application's module name from `config/application.rb`.
243
- For example, `MyApp` will displayed as `my-app` in the prompt.
244
-
245
- Additionally, the environment name will be colorized when the environment is
246
- `development` (blue), `test` (blue), or `production` (red), if your
247
- terminal supports it.
248
-
249
- *Stan Lo*
250
-
251
- * Ensure `autoload_paths`, `autoload_once_paths`, `eager_load_paths`, and
252
- `load_paths` only have directories when initialized from engine defaults.
253
-
254
- Previously, files under the `app` directory could end up there too.
255
-
256
- *Takumasa Ochi*
257
-
258
- * Prevent unnecessary application reloads in development.
259
-
260
- Previously, some files outside autoload paths triggered unnecessary reloads.
261
- With this fix, application reloads according to `Rails.autoloaders.main.dirs`,
262
- thereby preventing unnecessary reloads.
263
-
264
- *Takumasa Ochi*
265
-
266
- * Use `oven-sh/setup-bun` in GitHub CI when generating an app with Bun.
267
-
268
- *TangRufus*
269
-
270
- * Disable `pidfile` generation in the `production` environment.
228
+ Generated files:
271
229
 
272
- *Hans Schnedlitz*
230
+ ```
231
+ app/models/current.rb
232
+ app/models/user.rb
233
+ app/models/session.rb
234
+ app/controllers/sessions_controller.rb
235
+ app/controllers/passwords_controller.rb
236
+ app/mailers/passwords_mailer.rb
237
+ app/views/sessions/new.html.erb
238
+ app/views/passwords/new.html.erb
239
+ app/views/passwords/edit.html.erb
240
+ app/views/passwords_mailer/reset.html.erb
241
+ app/views/passwords_mailer/reset.text.erb
242
+ db/migrate/xxxxxxx_create_users.rb
243
+ db/migrate/xxxxxxx_create_sessions.rb
244
+ test/mailers/previews/passwords_mailer_preview.rb
245
+ ```
273
246
 
274
- * Set `config.action_view.annotate_rendered_view_with_filenames` to `true` in
275
- the `development` environment.
247
+ *DHH*
276
248
 
277
- *Adrian Marin*
278
249
 
279
- * Support the `BACKTRACE` environment variable to turn off backtrace cleaning.
250
+ * Add not-null type modifier to migration attributes.
280
251
 
281
- Useful for debugging framework code:
252
+ Generating with...
282
253
 
283
- ```sh
284
- BACKTRACE=1 bin/rails server
254
+ ```
255
+ bin/rails generate migration CreateUsers email_address:string!:uniq password_digest:string!
285
256
  ```
286
257
 
287
- *Alex Ghiculescu*
288
-
289
- * Raise `ArgumentError` when reading `config.x.something` with arguments:
258
+ Produces:
290
259
 
291
260
  ```ruby
292
- config.x.this_works.this_raises true # raises ArgumentError
261
+ class CreateUsers < ActiveRecord::Migration[8.0]
262
+ def change
263
+ create_table :users do |t|
264
+ t.string :email_address, null: false
265
+ t.string :password_digest, null: false
266
+
267
+ t.timestamps
268
+ end
269
+ add_index :users, :email_address, unique: true
270
+ end
271
+ end
293
272
  ```
294
273
 
295
- *Sean Doyle*
296
-
297
- * 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.
298
-
299
- *DHH*
300
-
301
- * Updated system tests to now use headless Chrome by default for the new applications.
302
-
303
274
  *DHH*
304
275
 
305
- * Add GitHub CI files for Dependabot, Brakeman, RuboCop, and running tests by default. Can be skipped with `--skip-ci`.
306
-
307
- *DHH*
308
-
309
- * Add Brakeman by default for static analysis of security vulnerabilities. Allow skipping with `--skip-brakeman option`.
310
-
311
- *vipulnsward*
312
-
313
- * Add RuboCop with rules from `rubocop-rails-omakase` by default. Skip with `--skip-rubocop`.
314
-
315
- *DHH* and *zzak*
316
-
317
- * Use `bin/rails runner --skip-executor` to not wrap the runner script with an
318
- Executor.
319
-
320
- *Ben Sheldon*
321
-
322
- * Fix isolated engines to take `ActiveRecord::Base.table_name_prefix` into consideration.
323
-
324
- This will allow for engine defined models, such as inside Active Storage, to respect
325
- Active Record table name prefix configuration.
326
-
327
- *Chedli Bourguiba*
276
+ * Add a `script` folder to applications, and a scripts generator.
328
277
 
329
- * Fix running `db:system:change` when the app has no Dockerfile.
278
+ The new `script` folder is meant to hold one-off or general purpose scripts,
279
+ such as data migration scripts, cleanup scripts, etc.
330
280
 
331
- *Hartley McGuire*
332
-
333
- * In Action Mailer previews, list inline attachments separately from normal
334
- attachments.
335
-
336
- For example, attachments that were previously listed like
337
-
338
- > Attachments: logo.png file1.pdf file2.pdf
339
-
340
- will now be listed like
341
-
342
- > Attachments: file1.pdf file2.pdf (Inline: logo.png)
343
-
344
- *Christian Schmidt* and *Jonathan Hefner*
345
-
346
- * In mailer preview, only show SMTP-To if it differs from the union of To, Cc and Bcc.
347
-
348
- *Christian Schmidt*
349
-
350
- * Enable YJIT by default on new applications running Ruby 3.3+.
351
-
352
- This can be disabled by setting `Rails.application.config.yjit = false`
353
-
354
- *Jean Boussier*, *Rafael Mendonça França*
355
-
356
- * In Action Mailer previews, show date from message `Date` header if present.
357
-
358
- *Sampat Badhe*
359
-
360
- * Exit with non-zero status when the migration generator fails.
361
-
362
- *Katsuhiko YOSHIDA*
363
-
364
- * Use numeric UID and GID in Dockerfile template.
365
-
366
- The Dockerfile generated by `rails new` sets the default user and group
367
- by name instead of UID:GID. This can cause the following error in Kubernetes:
281
+ A new script generator allows you to create such scripts:
368
282
 
369
283
  ```
370
- container has runAsNonRoot and image has non-numeric user (rails), cannot verify user is non-root
284
+ bin/rails generate script my_script
285
+ bin/rails generate script data/backfill
371
286
  ```
372
287
 
373
- This change sets default user and group by their numeric values.
374
-
375
- *Ivan Fedotov*
288
+ You can run the generated script using:
376
289
 
377
- * Disallow invalid values for rails new options.
290
+ ```
291
+ bundle exec ruby script/my_script.rb
292
+ bundle exec ruby script/data/backfill.rb
293
+ ```
378
294
 
379
- The `--database`, `--asset-pipeline`, `--css`, and `--javascript` options
380
- for `rails new` take different arguments. This change validates them.
295
+ *Jerome Dalbert*, *Haroon Ahmed*
381
296
 
382
- *Tony Drake*, *Akhil G Krishnan*, *Petrik de Heus*
297
+ * Deprecate `bin/rake stats` in favor of `bin/rails stats`.
383
298
 
384
- * Conditionally print `$stdout` when invoking `run_generator`.
299
+ *Juan Vásquez*
385
300
 
386
- In an effort to improve the developer experience when debugging
387
- generator tests, we add the ability to conditionally print `$stdout`
388
- instead of capturing it.
301
+ * Add internal page `/rails/info/notes`, that displays the same information as `bin/rails notes`.
389
302
 
390
- This allows for calls to `binding.irb` and `puts` work as expected.
303
+ *Deepak Mahakale*
391
304
 
392
- ```sh
393
- RAILS_LOG_TO_STDOUT=true ./bin/test test/generators/actions_test.rb
394
- ```
305
+ * Add Rubocop and GitHub Actions to plugin generator.
306
+ This can be skipped using --skip-rubocop and --skip-ci.
395
307
 
396
- *Steve Polito*
308
+ *Chris Oliver*
397
309
 
398
- * Remove the option `config.public_file_server.enabled` from the generators
399
- for all environments, as the value is the same in all environments.
310
+ * Use Kamal for deployment by default, which includes generating a Rails-specific config/deploy.yml.
311
+ This can be skipped using --skip-kamal. See more: https://kamal-deploy.org/
400
312
 
401
- *Adrian Hirt*
313
+ *DHH*
402
314
 
403
- Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/railties/CHANGELOG.md) for previous changes.
315
+ Please check [7-2-stable](https://github.com/rails/rails/blob/7-2-stable/railties/CHANGELOG.md) for previous changes.
@@ -80,6 +80,13 @@ module Minitest
80
80
  options[:fail_fast] = true
81
81
  end
82
82
 
83
+ if Minitest::VERSION > "6" then
84
+ opts.on "-n", "--name PATTERN", "Include /regexp/ or string for run." do |a|
85
+ warn "Please switch from -n/--name to -i/--include"
86
+ options[:include] = a
87
+ end
88
+ end
89
+
83
90
  opts.on("-c", "--[no-]color", "Enable color in the output") do |value|
84
91
  options[:color] = value
85
92
  end
@@ -110,7 +117,7 @@ module Minitest
110
117
  # minitest-reporters, maxitest, and others.
111
118
  def self.plugin_rails_init(options)
112
119
  # Don't mess with Minitest unless RAILS_ENV is set
113
- return unless ENV["RAILS_ENV"]
120
+ return unless ENV["RAILS_ENV"] || ENV["RAILS_MINITEST_PLUGIN"]
114
121
 
115
122
  unless options[:full_backtrace]
116
123
  # Plugin can run without Rails loaded, check before filtering.
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "fileutils"
4
- require "set"
5
4
  require "active_support/notifications"
6
5
  require "active_support/dependencies"
7
6
  require "active_support/descendants_tracker"