railties 7.0.8 → 7.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +635 -208
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.md +99 -0
  5. data/README.rdoc +4 -4
  6. data/lib/minitest/rails_plugin.rb +63 -0
  7. data/lib/rails/api/task.rb +35 -4
  8. data/lib/rails/app_updater.rb +1 -1
  9. data/lib/rails/application/bootstrap.rb +18 -3
  10. data/lib/rails/application/configuration.rb +179 -67
  11. data/lib/rails/application/default_middleware_stack.rb +8 -2
  12. data/lib/rails/application/dummy_config.rb +19 -0
  13. data/lib/rails/application/finisher.rb +40 -33
  14. data/lib/rails/application.rb +112 -24
  15. data/lib/rails/backtrace_cleaner.rb +1 -1
  16. data/lib/rails/cli.rb +5 -2
  17. data/lib/rails/command/actions.rb +10 -12
  18. data/lib/rails/command/base.rb +55 -53
  19. data/lib/rails/command/environment_argument.rb +32 -16
  20. data/lib/rails/command/helpers/editor.rb +17 -12
  21. data/lib/rails/command.rb +84 -33
  22. data/lib/rails/commands/about/about_command.rb +14 -0
  23. data/lib/rails/commands/application/application_command.rb +2 -0
  24. data/lib/rails/commands/console/console_command.rb +14 -14
  25. data/lib/rails/commands/credentials/USAGE +53 -55
  26. data/lib/rails/commands/credentials/credentials_command/diffing.rb +5 -3
  27. data/lib/rails/commands/credentials/credentials_command.rb +64 -70
  28. data/lib/rails/commands/db/system/change/change_command.rb +2 -1
  29. data/lib/rails/commands/dbconsole/dbconsole_command.rb +25 -115
  30. data/lib/rails/commands/destroy/destroy_command.rb +3 -2
  31. data/lib/rails/commands/dev/dev_command.rb +1 -6
  32. data/lib/rails/commands/encrypted/USAGE +15 -20
  33. data/lib/rails/commands/encrypted/encrypted_command.rb +46 -35
  34. data/lib/rails/commands/gem_help/USAGE +16 -0
  35. data/lib/rails/commands/gem_help/gem_help_command.rb +13 -0
  36. data/lib/rails/commands/generate/generate_command.rb +2 -2
  37. data/lib/rails/commands/help/USAGE +13 -13
  38. data/lib/rails/commands/help/help_command.rb +21 -2
  39. data/lib/rails/commands/initializers/initializers_command.rb +1 -4
  40. data/lib/rails/commands/middleware/middleware_command.rb +17 -0
  41. data/lib/rails/commands/new/new_command.rb +2 -0
  42. data/lib/rails/commands/notes/notes_command.rb +2 -1
  43. data/lib/rails/commands/plugin/plugin_command.rb +2 -0
  44. data/lib/rails/commands/rake/rake_command.rb +25 -22
  45. data/lib/rails/commands/restart/restart_command.rb +14 -0
  46. data/lib/rails/commands/routes/routes_command.rb +13 -1
  47. data/lib/rails/commands/runner/USAGE +14 -12
  48. data/lib/rails/commands/runner/runner_command.rb +32 -20
  49. data/lib/rails/commands/secret/secret_command.rb +13 -0
  50. data/lib/rails/commands/secrets/USAGE +44 -49
  51. data/lib/rails/commands/secrets/secrets_command.rb +19 -38
  52. data/lib/rails/commands/server/server_command.rb +33 -32
  53. data/lib/rails/commands/test/USAGE +14 -0
  54. data/lib/rails/commands/test/test_command.rb +56 -14
  55. data/lib/rails/commands/unused_routes/unused_routes_command.rb +75 -0
  56. data/lib/rails/commands/version/version_command.rb +1 -0
  57. data/lib/rails/configuration.rb +5 -5
  58. data/lib/rails/console/app.rb +1 -4
  59. data/lib/rails/deprecator.rb +7 -0
  60. data/lib/rails/engine/configuration.rb +5 -0
  61. data/lib/rails/engine.rb +32 -11
  62. data/lib/rails/gem_version.rb +3 -3
  63. data/lib/rails/generators/actions.rb +6 -15
  64. data/lib/rails/generators/active_model.rb +28 -14
  65. data/lib/rails/generators/app_base.rb +358 -83
  66. data/lib/rails/generators/app_name.rb +3 -14
  67. data/lib/rails/generators/base.rb +12 -4
  68. data/lib/rails/generators/database.rb +39 -1
  69. data/lib/rails/generators/erb/mailer/templates/layout.html.erb.tt +1 -1
  70. data/lib/rails/generators/generated_attribute.rb +12 -0
  71. data/lib/rails/generators/migration.rb +1 -2
  72. data/lib/rails/generators/model_helpers.rb +2 -1
  73. data/lib/rails/generators/rails/app/USAGE +22 -6
  74. data/lib/rails/generators/rails/app/app_generator.rb +84 -60
  75. data/lib/rails/generators/rails/app/templates/Dockerfile.tt +103 -0
  76. data/lib/rails/generators/rails/app/templates/Gemfile.tt +9 -11
  77. data/lib/rails/generators/rails/app/templates/app/views/layouts/mailer.html.erb.tt +1 -1
  78. data/lib/rails/generators/rails/app/templates/bin/setup.tt +10 -1
  79. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +6 -17
  80. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +4 -4
  81. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +3 -3
  82. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +4 -6
  83. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +3 -3
  84. data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +59 -0
  85. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +12 -2
  86. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +29 -25
  87. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +11 -7
  88. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +2 -0
  89. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +2 -2
  90. data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +1 -1
  91. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +3 -3
  92. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.tt +223 -0
  93. data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +11 -9
  94. data/lib/rails/generators/rails/app/templates/config/locales/en.yml +11 -13
  95. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +11 -19
  96. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +5 -1
  97. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +6 -4
  98. data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +10 -0
  99. data/lib/rails/generators/rails/app/templates/dockerignore.tt +43 -0
  100. data/lib/rails/generators/rails/app/templates/gitignore.tt +4 -8
  101. data/lib/rails/generators/rails/app/templates/node-version.tt +1 -0
  102. data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +10 -8
  103. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +9 -7
  104. data/lib/rails/generators/rails/application_record/application_record_generator.rb +4 -0
  105. data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +2 -1
  106. data/lib/rails/generators/rails/controller/USAGE +12 -4
  107. data/lib/rails/generators/rails/controller/controller_generator.rb +5 -0
  108. data/lib/rails/generators/rails/controller/templates/controller.rb.tt +1 -1
  109. data/lib/rails/generators/rails/credentials/credentials_generator.rb +29 -24
  110. data/lib/rails/generators/rails/credentials/templates/credentials.yml.tt +8 -0
  111. data/lib/rails/generators/rails/db/system/change/change_generator.rb +27 -0
  112. data/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +1 -2
  113. data/lib/rails/generators/rails/migration/USAGE +21 -11
  114. data/lib/rails/generators/rails/model/model_generator.rb +4 -0
  115. data/lib/rails/generators/rails/plugin/USAGE +17 -6
  116. data/lib/rails/generators/rails/plugin/plugin_generator.rb +5 -15
  117. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +2 -2
  118. data/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt +1 -1
  119. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +1 -17
  120. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +0 -2
  121. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +4 -4
  122. data/lib/rails/generators/rails/resource/resource_generator.rb +6 -0
  123. data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +2 -1
  124. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +1 -1
  125. data/lib/rails/generators/test_case.rb +2 -2
  126. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +1 -1
  127. data/lib/rails/generators/testing/{behaviour.rb → behavior.rb} +4 -1
  128. data/lib/rails/generators.rb +5 -13
  129. data/lib/rails/health_controller.rb +55 -0
  130. data/lib/rails/info.rb +1 -1
  131. data/lib/rails/info_controller.rb +31 -11
  132. data/lib/rails/mailers_controller.rb +15 -5
  133. data/lib/rails/paths.rb +13 -10
  134. data/lib/rails/rack/logger.rb +15 -12
  135. data/lib/rails/rackup/server.rb +15 -0
  136. data/lib/rails/railtie/configuration.rb +14 -1
  137. data/lib/rails/railtie.rb +18 -18
  138. data/lib/rails/ruby_version_check.rb +2 -0
  139. data/lib/rails/source_annotation_extractor.rb +67 -18
  140. data/lib/rails/tasks/engine.rake +8 -8
  141. data/lib/rails/tasks/framework.rake +4 -10
  142. data/lib/rails/tasks/log.rake +1 -1
  143. data/lib/rails/tasks/misc.rake +3 -14
  144. data/lib/rails/tasks/statistics.rake +5 -4
  145. data/lib/rails/tasks/tmp.rake +5 -5
  146. data/lib/rails/tasks/zeitwerk.rake +1 -1
  147. data/lib/rails/tasks.rb +0 -2
  148. data/lib/rails/templates/rails/mailers/email.html.erb +25 -0
  149. data/lib/rails/templates/rails/mailers/index.html.erb +14 -7
  150. data/lib/rails/templates/rails/mailers/mailer.html.erb +11 -5
  151. data/lib/rails/templates/rails/welcome/index.html.erb +1 -0
  152. data/lib/rails/test_help.rb +9 -14
  153. data/lib/rails/test_unit/line_filtering.rb +1 -1
  154. data/lib/rails/test_unit/reporter.rb +6 -2
  155. data/lib/rails/test_unit/runner.rb +36 -18
  156. data/lib/rails/test_unit/test_parser.rb +88 -0
  157. data/lib/rails/test_unit/testing.rake +13 -33
  158. data/lib/rails/testing/maintain_test_schema.rb +16 -0
  159. data/lib/rails/version.rb +1 -1
  160. data/lib/rails.rb +15 -15
  161. metadata +64 -28
  162. data/RDOC_MAIN.rdoc +0 -97
  163. data/lib/rails/application/dummy_erb_compiler.rb +0 -18
  164. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt +0 -143
  165. data/lib/rails/generators/rails/model/USAGE +0 -113
  166. data/lib/rails/tasks/middleware.rake +0 -9
  167. data/lib/rails/tasks/restart.rake +0 -9
data/CHANGELOG.md CHANGED
@@ -1,20 +1,105 @@
1
- ## Rails 7.0.8 (September 09, 2023) ##
1
+ ## Rails 7.1.1 (October 11, 2023) ##
2
2
 
3
- * Omit `webdrivers` gem dependency from `Gemfile` template
3
+ * Ensures the Rails generated Dockerfile uses correct ruby version and matches Gemfile.
4
+
5
+ *Abhay Nikam*
4
6
 
5
- *Sean Doyle*
6
7
 
7
- ## Rails 7.0.7.2 (August 22, 2023) ##
8
+ ## Rails 7.1.0 (October 05, 2023) ##
8
9
 
9
10
  * No changes.
10
11
 
11
12
 
12
- ## Rails 7.0.7.1 (August 22, 2023) ##
13
+ ## Rails 7.1.0.rc2 (October 01, 2023) ##
13
14
 
14
- * No changes.
15
+ * Always set the Rails logger to be an instance of `ActiveSupport::BroadcastLogger`.
16
+
17
+ *Edouard Chin*
18
+
19
+
20
+ ## Rails 7.1.0.rc1 (September 27, 2023) ##
21
+
22
+ * Require `concurrent-ruby` in `config/puma.rb` so that Puma can boot in
23
+ production when `WEB_CONCURRENCY` is not explicitly specified.
24
+
25
+ Fixes #49323.
26
+
27
+ *Matt Brictson*
28
+
29
+ * Raise error when generating attribute with dangerous name.
30
+
31
+ The following will now raise an error as `save` and `hash` are already
32
+ defined by Active Record.
33
+
34
+ ```bash
35
+ $ bin/rails generate model Post save
36
+ $ bin/rails generate model Post hash
37
+ ```
38
+
39
+ *Petrik de Heus*
40
+
41
+
42
+ ## Rails 7.1.0.beta1 (September 13, 2023) ##
43
+
44
+ * Add ability to show slow tests to the test runner
45
+
46
+ ```bash
47
+ $ bin/test --profile # additionally prints 10 (default) slowest tests
48
+ # or
49
+ $ bin/test --profile 20 # prints 20 slowest tests
50
+ ```
51
+
52
+ *fatkodima*
53
+
54
+ * `rails new --javascript` generator now supports Bun
55
+
56
+ ```bash
57
+ $ rails new my_new_app --javascript=bun
58
+ ```
59
+
60
+ *Jason Meller*
61
+
62
+ * bin/setup uses `bun` instead of `yarn` when generated an app with bun
63
+
64
+ Use `bun install` on `bin/setup` when using `bun`.
65
+
66
+ *Cadu Ribeiro*
67
+
68
+ * `config/application.rb` now includes
69
+
70
+ ```ruby
71
+ config.autoload_lib(ignore: %w(assets tasks))
72
+ ```
73
+
74
+ In practice, this means that new 7.1 applications autoload from `lib` out of the box.
75
+
76
+ *Xavier Noria*
15
77
 
78
+ * Add an option to start rails console in sandbox mode by default
16
79
 
17
- ## Rails 7.0.7 (August 09, 2023) ##
80
+ `sandbox_by_default` option is added to start rails console in sandbox
81
+ mode by default. With this option turned on, `--no-sandbox` must be
82
+ specified to start rails in non-sandbox mode.
83
+
84
+ Note that this option is ignored when rails environment is development
85
+ or test.
86
+
87
+ *Shouichi Kamiya*
88
+
89
+ * Omit `webdrivers` gem dependency from `Gemfile` template
90
+
91
+ *Sean Doyle*
92
+
93
+ * Support filtering tests by line ranges
94
+
95
+ The new syntax allows you to filter tests by line ranges. For example, the
96
+ following command runs tests from line 10 to 20.
97
+
98
+ ```bash
99
+ $ rails test test/models/user_test.rb:10-20
100
+ ```
101
+
102
+ *Shouichi Kamiya*, *Seonggi Yang*, *oljfte*, *Ryohei UEDA*
18
103
 
19
104
  * Update default scaffold templates to set 303 (See Other) as status code
20
105
  on redirect for the update action for XHR requests other than GET or POST
@@ -23,386 +108,728 @@
23
108
 
24
109
  *Guillermo Iguaran*
25
110
 
111
+ * The new `config.autoload_lib_once` is similar to `config.autoload_lib`,
112
+ except that it adds `lib` to `config.autoload_once_paths` instead.
26
113
 
27
- ## Rails 7.0.6 (June 29, 2023) ##
28
- * Avoid escaping paths when editing credentials.
114
+ By calling `config.autoload_lib_once`, classes and modules in `lib` can be
115
+ autoloaded, even from application initializers, but won't be reloaded.
29
116
 
30
- *Jonathan Hefner*
117
+ Please, see further details in the [autoloading
118
+ guide](https://guides.rubyonrails.org/v7.1/autoloading_and_reloading_constants.html).
31
119
 
120
+ *Xavier Noria*
32
121
 
33
- ## Rails 7.0.5.1 (June 26, 2023) ##
122
+ * Add `config.action_dispatch.debug_exception_log_level` to configure the log
123
+ level used by `ActionDispatch::DebugExceptions`.
34
124
 
35
- * No changes.
125
+ The default is `:fatal`, but with `load_defaults "7.1"` the default will be
126
+ `:error`.
36
127
 
128
+ *Hartley McGuire*
37
129
 
38
- ## Rails 7.0.5 (May 24, 2023) ##
130
+ * Add `DATABASE` option to `railties:install:migrations`
39
131
 
40
- * Add puma app server to Gemfile in order to start test/dummy.
132
+ This allows you to specify which database the migrations should be copied to
133
+ when running `rails railties:install:migrations`.
41
134
 
42
- *Donapieppo*
135
+ ```bash
136
+ $ rails railties:install:migrations DATABASE=animals
137
+ ```
43
138
 
44
- * Rails console now disables `IRB`'s autocompletion feature in production by default.
139
+ *Matthew Hirst*
45
140
 
46
- Setting `IRB_USE_AUTOCOMPLETE=true` can override this default.
141
+ * The new method `config.autoload_lib(ignore:)` provides a simple way to
142
+ autoload from `lib`:
47
143
 
48
- *Stan Lo*
144
+ ```ruby
145
+ # config/application.rb
146
+ config.autoload_lib(ignore: %w(assets tasks))
147
+ ```
49
148
 
50
- * Send 303 See Other status code back for the destroy action on newly generated
51
- scaffold controllers.
149
+ Please, see further details in the [autoloading
150
+ guide](https://guides.rubyonrails.org/v7.1/autoloading_and_reloading_constants.html).
52
151
 
53
- *Tony Drake*
152
+ *Xavier Noria*
54
153
 
154
+ * Don't show secret_key_base for `Rails.application.config#inspect`.
55
155
 
56
- ## Rails 7.0.4.3 (March 13, 2023) ##
156
+ Before:
57
157
 
58
- * No changes.
158
+ ```ruby
159
+ Rails.application.config.inspect
160
+ "#<Rails::Application::Configuration:0x00000001132b02a0 @root=... @secret_key_base=\"b3c631c314c0bbca50c1b2843150fe33\" ... >"
161
+ ```
59
162
 
163
+ After:
60
164
 
61
- ## Rails 7.0.4.2 (January 24, 2023) ##
165
+ ```ruby
166
+ Rails.application.config.inspect
167
+ "#<Rails::Application::Configuration:0x00000001132b02a0>"
168
+ ```
62
169
 
63
- * No changes.
170
+ *Petrik de Heus*
64
171
 
172
+ * Deprecate calling `Rails.application.secrets`.
65
173
 
66
- ## Rails 7.0.4.1 (January 17, 2023) ##
174
+ Rails `secrets` have been deprecated in favor of `credentials`.
175
+ Calling `Rails.application.secrets` should show a deprecation warning.
67
176
 
68
- * No changes.
177
+ *Petrik de Heus*
69
178
 
179
+ * Store `secret_key_base` in `Rails.config` for local environments.
70
180
 
71
- ## Rails 7.0.4 (September 09, 2022) ##
181
+ Rails `secrets` have been deprecated in favor of `credentials`.
182
+ For the local environments the `secret_key_base` is now stored in
183
+ `Rails.config.secret_key_base` instead of the soft deprecated
184
+ `Rails.application.secrets.secret_key_base`.
72
185
 
73
- * `config.allow_concurrency = false` now use a `Monitor` instead of a `Mutex`
186
+ *Petrik de Heus*
74
187
 
75
- This allows to enable `config.active_support.executor_around_test_case` even
76
- when `config.allow_concurrency` is disabled.
188
+ * Enable force_ssl=true in production by default: Force all access to the app over SSL,
189
+ use Strict-Transport-Security, and use secure cookies
77
190
 
78
- *Jean Boussier*
191
+ *Justin Searls*, *Aaron Patterson*, *Guillermo Iguaran*, *Vinícius Bispo*
79
192
 
80
- * Skip Active Storage and Action Mailer if Active Job is skipped.
193
+ * Add engine's draw paths to application route set, so that the application
194
+ can draw route files defined in engine paths.
81
195
 
82
- *Étienne Barrié*
196
+ *Gannon McGibbon*
83
197
 
84
- * Correctly check if frameworks are disabled when running app:update.
198
+ * Support `VISUAL` environment variable for commands which open an editor,
199
+ and prefer it over `EDITOR`.
85
200
 
86
- *Étienne Barrié* and *Paulo Barros*
201
+ *Summer ☀️*
87
202
 
88
- * Fixed `config.active_support.cache_format_version` never being applied.
203
+ * Add engine's `test/fixtures` path to `fixture_paths` in `on_load` hook if
204
+ path exists and is under the Rails application root.
89
205
 
90
- Rails 7.0 shipped with a new serializer for Rails.cache, but the associated config
91
- wasn't working properly. Note that even after this fix, it can only be applied from
92
- the `application.rb` file.
206
+ *Chris Salzberg*
93
207
 
94
- *Alex Ghiculescu*
208
+ * `bin/rails app:template` now runs `bundle install` and any `after_bundle`
209
+ blocks after the template is executed.
95
210
 
211
+ *Jonathan Hefner* and *Gerry Caulfield*
96
212
 
97
- ## Rails 7.0.3.1 (July 12, 2022) ##
213
+ * Enable passing column size to migration generator
98
214
 
99
- * No changes.
215
+ Previously you could pass a limit to the migration generator:
100
216
 
217
+ `rails generate migration CreateAuthor name:text{65535}`
101
218
 
102
- ## Rails 7.0.3 (May 09, 2022) ##
219
+ Now, a size attribute can be passed to the migration generator:
103
220
 
104
- * If reloading and eager loading are both enabled, after a reload Rails eager loads again the application code.
221
+ `rails generate migration CreateAuthor name:text{medium}`
105
222
 
106
- *Xavier Noria*
223
+ This generates a migration which includes the size attribute:
107
224
 
108
- * Use `controller_class_path` in `Rails::Generators::NamedBase#route_url`
225
+ ```ruby
226
+ class CreateAuthor < ActiveRecord::Migration[7.1]
227
+ def change
228
+ create_table :authors do |t|
229
+ t.text :name, size: :medium
230
+ end
231
+ end
232
+ end
233
+ ```
109
234
 
110
- The `route_url` method now returns the correct path when generating
111
- a namespaced controller with a top-level model using `--model-name`.
235
+ *Josh Broughton*, *Hartley McGuire*
112
236
 
113
- Previously, when running this command:
237
+ * Trying to set a config key with the same name of a method now raises:
114
238
 
115
- ``` sh
116
- bin/rails generate scaffold_controller Admin/Post --model-name Post
239
+ ```ruby
240
+ config.load_defaults = 7.0
241
+ # NoMethodError: Cannot assign to `load_defaults`, it is a configuration method
117
242
  ```
118
243
 
119
- the comments above the controller action would look like:
244
+ *Xavier Noria*
120
245
 
121
- ``` ruby
122
- # GET /posts
123
- def index
124
- @posts = Post.all
125
- end
126
- ```
246
+ * Deprecate `secrets:edit/show` and remove `secrets:setup`
127
247
 
128
- afterwards, they now look like this:
248
+ `bin/rails secrets:setup` has been deprecated since Rails 5.2 in favor of
249
+ credentials. This command has been removed.
129
250
 
130
- ``` ruby
131
- # GET /admin/posts
132
- def index
133
- @posts = Post.all
134
- end
251
+ `bin/rails secrets:show` and `bin/rails secrets:edit` have been deprecated
252
+ in favor of credentials.
253
+
254
+ Run `bin/rails credentials:help` for more information
255
+
256
+ *Petrik de Heus*
257
+
258
+ * `bin/rails --help` will now list only framework and plugin commands. Rake
259
+ tasks defined in `lib/tasks/*.rake` files will no longer be included. For a
260
+ list of those tasks, use `rake -T`.
261
+
262
+ *Jonathan Hefner*
263
+
264
+ * Allow calling `bin/rails restart` outside of app directory.
265
+
266
+ The following would previously fail with a "No Rakefile found" error.
267
+
268
+ ```bash
269
+ $ blog/bin/rails restart
135
270
  ```
136
271
 
137
- Fixes #44662.
272
+ *Petrik de Heus*
138
273
 
139
- *Andrew White*
274
+ * Support prerelease rubies in Gemfile template if RubyGems version is 3.3.13 or higher.
140
275
 
141
- ## Rails 7.0.2.4 (April 26, 2022) ##
276
+ *Yasuo Honda*, *David Rodríguez*
142
277
 
143
- * No changes.
278
+ * Autoloading setup honors root directories manually set by the user.
144
279
 
280
+ This is relevant for custom namespaces. For example, if you'd like classes
281
+ and modules under `app/services` to be defined in the `Services` namespace
282
+ without an extra `app/services/services` directory, this is now enough:
145
283
 
146
- ## Rails 7.0.2.3 (March 08, 2022) ##
284
+ ```ruby
285
+ # config/initializers/autoloading.rb
147
286
 
148
- * No changes.
287
+ # The namespace has to exist.
288
+ #
289
+ # In this example we define the module on the spot. Could also be created
290
+ # elsewhere and its definition loaded here with an ordinary `require`. In
291
+ # any case, `push_dir` expects a class or module object.
292
+ module Services; end
149
293
 
294
+ Rails.autoloaders.main.push_dir("#{Rails.root}/app/services", namespace: Services)
295
+ ```
150
296
 
151
- ## Rails 7.0.2.2 (February 11, 2022) ##
297
+ Check the autoloading guide for further details.
152
298
 
153
- * No changes.
299
+ *Xavier Noria*
154
300
 
301
+ * Railties now requires the irb gem as a dependency, which means when you install Rails, irb will also
302
+ be installed as a gem. Rails will then use the installed version of irb for its console instead of
303
+ relying on Ruby's built-in version.
304
+ This ensures that Rails has access to the most up-to-date and reliable version of irb for its console.
155
305
 
156
- ## Rails 7.0.2.1 (February 11, 2022) ##
306
+ *Stan Lo*
157
307
 
158
- * No changes.
308
+ * Use infinitive form for all rails command descriptions verbs.
159
309
 
310
+ *Petrik de Heus*
160
311
 
161
- ## Rails 7.0.2 (February 08, 2022) ##
312
+ * Credentials commands (e.g. `bin/rails credentials:edit`) now respect
313
+ `config.credentials.content_path` and `config.credentials.key_path` when set
314
+ in `config/application.rb` or `config/environments/#{Rails.env}.rb`.
162
315
 
163
- * No changes.
316
+ Before:
164
317
 
318
+ * `bin/rails credentials:edit` ignored `RAILS_ENV`, and would always edit
319
+ `config/credentials.yml.enc`.
165
320
 
166
- ## Rails 7.0.1 (January 06, 2022) ##
321
+ * `bin/rails credentials:edit --environment foo` would create and edit
322
+ `config/credentials/foo.yml.enc`.
167
323
 
168
- * Prevent duplicate entries in plugin Gemfile.
324
+ * If `config.credentials.content_path` or `config.credentials.key_path`
325
+ was set, `bin/rails credentials:edit` could not be used to edit the
326
+ credentials. Editing credentials required using `bin/rails
327
+ encrypted:edit path/to/credentials --key path/to/key`.
169
328
 
170
- *Jonathan Hefner*
329
+ After:
171
330
 
172
- * Fix asset pipeline errors for plugin dummy apps.
331
+ * `bin/rails credentials:edit` will edit the credentials file that the app
332
+ would load for the current `RAILS_ENV`.
173
333
 
174
- *Jonathan Hefner*
334
+ * `bin/rails credentials:edit` respects `config.credentials.content_path`
335
+ and `config.credentials.key_path` when set in `config/application.rb`
336
+ or `config/environments/#{Rails.env}.rb`.
175
337
 
176
- * Fix generated route revocation.
338
+ * `bin/rails credentials:edit --environment foo` will create and edit
339
+ `config/credentials/foo.yml.enc` _if_ `config.credentials.content_path`
340
+ has not been set for the `foo` environment. Ultimately, it will edit
341
+ the credentials file that the app would load for the `foo` environment.
177
342
 
178
343
  *Jonathan Hefner*
179
344
 
180
- * Addresses an issue in which Sidekiq jobs could not reload certain
181
- namespaces.
345
+ * Add descriptions for non-Rake commands when running `rails -h`.
182
346
 
183
- See [fxn/zeitwerk#198](https://github.com/fxn/zeitwerk/issues/198) for
184
- details.
347
+ *Petrik de Heus*
185
348
 
186
- *Xavier Noria*
349
+ * Show relevant commands when calling help
187
350
 
188
- * Fix plugin generator to a plugin that pass all the tests.
351
+ When running `rails -h` or just `rails` outside a Rails application,
352
+ Rails outputs all options for running the `rails new` command. This can be
353
+ confusing to users when they probably want to see the common Rails commands.
189
354
 
190
- *Rafael Mendonça França*
355
+ Instead, we should always show the common commands when running `rails -h`
356
+ inside or outside a Rails application.
191
357
 
358
+ As the relevant commands inside a Rails application differ from the
359
+ commands outside an application, the help USAGE file has been split to
360
+ show the most relevant commands for the context.
192
361
 
193
- ## Rails 7.0.0 (December 15, 2021) ##
362
+ *Petrik de Heus*
194
363
 
195
- * No changes.
364
+ * Add Rails::HealthController#show and map it to /up for newly generated applications.
365
+ Load balancers and uptime monitors all need a basic endpoint to tell whether the app is up.
366
+ This is a good starting point that'll work in many situations.
196
367
 
368
+ *DHH*
197
369
 
198
- ## Rails 7.0.0.rc3 (December 14, 2021) ##
370
+ * Only use HostAuthorization middleware if `config.hosts` is not empty
199
371
 
200
- * Allow localhost with a port by default in development
372
+ *Hartley McGuire*
201
373
 
202
- [Fixes: #43864]
374
+ * Raise an exception when a `before_action`'s "only" or "except" filter
375
+ options reference an action that doesn't exist. This will be enabled by
376
+ default but can be overridden via config.
203
377
 
204
- ## Rails 7.0.0.rc2 (December 14, 2021) ##
378
+ ```ruby
379
+ # config/environments/production.rb
380
+ config.action_controller.raise_on_missing_callback_actions = false
381
+ ```
205
382
 
206
- * No changes
383
+ *Jess Bees*
207
384
 
208
- ## Rails 7.0.0.rc1 (December 06, 2021) ##
385
+ * Use physical processor count as the default Puma worker count in production.
386
+ This can be overridden by setting `ENV["WEB_CONCURRENCY"]` or editing the
387
+ generated "config/puma.rb" directly.
209
388
 
210
- * Remove deprecated `config` in `dbconsole`.
389
+ *DHH*
211
390
 
212
- *Rafael Mendonça França*
391
+ * Add Docker files by default to new apps: Dockerfile, .dockerignore, bin/docker-entrypoint.
392
+ These files can be skipped with `--skip-docker`. They're intended as a starting point for
393
+ a production deploy of the application. Not intended for development (see Docked Rails for that).
213
394
 
214
- * Change default `X-XSS-Protection` header to disable XSS auditor
395
+ Example:
215
396
 
216
- This header has been deprecated and the XSS auditor it triggered
217
- has been removed from all major modern browsers (in favour of
218
- Content Security Policy) that implemented this header to begin with
219
- (Firefox never did).
397
+ ```bash
398
+ $ docker build -t app .
399
+ $ docker volume create app-storage
400
+ $ docker run --rm -it -v app-storage:/rails/storage -p 3000:3000 --env RAILS_MASTER_KEY=<see config/master.key> app
401
+ ```
220
402
 
221
- [OWASP](https://owasp.org/www-project-secure-headers/#x-xss-protection)
222
- suggests setting this header to '0' to disable the default behaviour
223
- on old browsers as it can introduce additional security issues.
403
+ You can also start a console or a runner from this image:
224
404
 
225
- Added the new behaviour as a framework default from Rails 7.0.
405
+ ```bash
406
+ $ docker run --rm -it -v app-storage:/rails/storage --env RAILS_MASTER_KEY=<see config/master.key> app console
407
+ ```
226
408
 
227
- *Christian Sutter*
409
+ To create a multi-platform image on Apple Silicon to deploy on AMD or Intel and push to Docker Hub for user/app:
228
410
 
229
- * Scaffolds now use date_field, time_field and datetime_field instead of
230
- date_select, time_select and datetime_select; thus providing native date/time pickers.
411
+ ```bash
412
+ $ docker login -u <user>
413
+ $ docker buildx create --use
414
+ $ docker buildx build --push --platform=linux/amd64,linux/arm64 -t <user/image> .
415
+ ```
231
416
 
232
- *Martijn Lafeber*
417
+ *DHH, Sam Ruby*
233
418
 
234
- * Fix a regression in which autoload paths were initialized too late.
419
+ * Add ENV["SECRET_KEY_BASE_DUMMY"] for starting production environment with a generated secret base key,
420
+ which can be used to run tasks like `assets:precompile` without making the RAILS_MASTER_KEY available
421
+ to the build process.
235
422
 
236
- *Xavier Noria*
423
+ Dockerfile layer example:
237
424
 
238
- ## Rails 7.0.0.alpha2 (September 15, 2021) ##
425
+ ```
426
+ RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile
427
+ ```
239
428
 
240
- * Fix activestorage dependency in the npm package.
429
+ *DHH*
241
430
 
242
- *Rafael Mendonça França*
431
+ * Show descriptions for all commands in Rails help
243
432
 
244
- ## Rails 7.0.0.alpha1 (September 15, 2021) ##
433
+ When calling `rails help` most commands missed their description. We now
434
+ show the same descriptions as shown in `rails -T`.
245
435
 
246
- * New and upgraded Rails apps no longer generate `config/initializers/application_controller_renderer.rb`
247
- or `config/initializers/cookies_serializer.rb`
436
+ *Petrik de Heus*
248
437
 
249
- The default value for `cookies_serializer` (`:json`) has been moved to `config.load_defaults("7.0")`.
250
- The new framework defaults file can be used to upgrade the serializer.
438
+ * Always generate the storage/ directory with rails new to ensure there's a stable place to
439
+ put permanent files, and a single mount point for containers to map. Then default sqlite3 databases
440
+ to live there instead of db/, which is only meant for configuration, not data.
251
441
 
252
- *Alex Ghiculescu*
442
+ *DHH*
253
443
 
254
- * New applications get a dependency on the new `debug` gem, replacing `byebug`.
444
+ * Rails console now disables `IRB`'s autocompletion feature in production by default.
255
445
 
256
- *Xavier Noria*
446
+ Setting `IRB_USE_AUTOCOMPLETE=true` can override this default.
257
447
 
258
- * Add SSL support for postgresql in `bin/rails dbconsole`.
448
+ *Stan Lo*
259
449
 
260
- Fixes #43114.
450
+ * Add `config.precompile_filter_parameters`, which enables precompilation of
451
+ `config.filter_parameters` using `ActiveSupport::ParameterFilter.precompile_filters`.
452
+ Precompilation can improve filtering performance, depending on the quantity
453
+ and types of filters.
261
454
 
262
- *Michael Bayucot*
455
+ `config.precompile_filter_parameters` defaults to `true` for
456
+ `config.load_defaults 7.1` and above.
263
457
 
264
- * Add support for comments above gem declaration in Rails application templates, e.g. `gem("nokogiri", comment: "For XML")`.
458
+ *Jonathan Hefner*
265
459
 
266
- *Linas Juškevičius*
460
+ * Add `after_routes_loaded` hook to `Rails::Railtie::Configuration` for
461
+ engines to add a hook to be called after application routes have been
462
+ loaded.
267
463
 
268
- * The setter `config.autoloader=` has been deleted. `zeitwerk` is the only
269
- available autoloading mode.
464
+ ```ruby
465
+ MyEngine.config.after_routes_loaded do
466
+ # code that must happen after routes have been loaded
467
+ end
468
+ ```
270
469
 
271
- *Xavier Noria*
470
+ *Chris Salzberg*
272
471
 
273
- * `config.autoload_once_paths` can be configured in the body of the
274
- application class defined in `config/application.rb` or in the configuration
275
- for environments in `config/environments/*`.
472
+ * Send 303 See Other status code back for the destroy action on newly generated
473
+ scaffold controllers.
276
474
 
277
- Similarly, engines can configure that collection in the class body of the
278
- engine class or in the configuration for environments.
475
+ *Tony Drake*
279
476
 
280
- After that, the collection is frozen, and you can autoload from those paths.
281
- They are managed by the `Rails.autoloaders.once` autoloader, which does not
282
- reload, only autoloads/eager loads.
477
+ * Add `Rails.application.deprecators` as a central point to manage deprecators
478
+ for an application.
283
479
 
284
- *Xavier Noria*
480
+ Individual deprecators can be added and retrieved from the collection:
285
481
 
286
- * During initialization, you cannot autoload reloadable classes or modules
287
- like application models, unless they are wrapped in a `to_prepare` block.
288
- For example, from `config/initializers/*`, or in application, engines, or
289
- railties initializers.
482
+ ```ruby
483
+ Rails.application.deprecators[:my_gem] = ActiveSupport::Deprecation.new("2.0", "MyGem")
484
+ Rails.application.deprecators[:other_gem] = ActiveSupport::Deprecation.new("3.0", "OtherGem")
485
+ ```
290
486
 
291
- Please check the [autoloading
292
- guide](https://guides.rubyonrails.org/v7.0/autoloading_and_reloading_constants.html#autoloading-when-the-application-boots)
293
- for details.
487
+ And the collection's configuration methods affect all deprecators in the
488
+ collection:
294
489
 
295
- *Xavier Noria*
490
+ ```ruby
491
+ Rails.application.deprecators.debug = true
296
492
 
297
- * While they are allowed to have elements in common, it is no longer required
298
- that `config.autoload_once_paths` is a subset of `config.autoload_paths`.
299
- The former are managed by the `once` autoloader. The `main` autoloader
300
- manages the latter minus the former.
493
+ Rails.application.deprecators[:my_gem].debug
494
+ # => true
495
+ Rails.application.deprecators[:other_gem].debug
496
+ # => true
497
+ ```
301
498
 
302
- *Xavier Noria*
499
+ Additionally, all deprecators in the collection can be silenced for the
500
+ duration of a given block:
303
501
 
304
- * Show Rake task description if command is run with `-h`.
502
+ ```ruby
503
+ Rails.application.deprecators.silence do
504
+ Rails.application.deprecators[:my_gem].warn # => silenced (no warning)
505
+ Rails.application.deprecators[:other_gem].warn # => silenced (no warning)
506
+ end
507
+ ```
305
508
 
306
- Adding `-h` (or `--help`) to a Rails command that's a Rake task now outputs
307
- the task description instead of the general Rake help.
509
+ *Jonathan Hefner*
308
510
 
309
- *Petrik de Heus*
511
+ * Move dbconsole logic to Active Record connection adapter.
310
512
 
311
- * Add missing `plugin new` command to help.
513
+ Instead of hosting the connection logic in the command object, the
514
+ database adapter should be responsible for connecting to a console session.
515
+ This patch moves #find_cmd_and_exec to the adapter and exposes a new API to
516
+ lookup the adapter class without instantiating it.
312
517
 
313
- *Petrik de Heus
518
+ *Gannon McGibbon*, *Paarth Madan*
314
519
 
315
- * Fix `config_for` error when there's only a shared root array.
520
+ * Add `Rails.application.message_verifiers` as a central point to configure
521
+ and create message verifiers for an application.
316
522
 
317
- *Loïc Delmaire*
523
+ This allows applications to, for example, rotate old `secret_key_base`
524
+ values:
318
525
 
319
- * Raise an error in generators if an index type is invalid.
526
+ ```ruby
527
+ config.before_initialize do |app|
528
+ app.message_verifiers.rotate(secret_key_base: "old secret_key_base")
529
+ end
530
+ ```
531
+
532
+ And for libraries to create preconfigured message verifiers:
533
+
534
+ ```ruby
535
+ ActiveStorage.verifier = Rails.application.message_verifiers["ActiveStorage"]
536
+ ```
537
+
538
+ *Jonathan Hefner*
539
+
540
+ * Support MySQL's ssl-mode option for the dbconsole command.
541
+
542
+ Verifying the identity of the database server requires setting the ssl-mode
543
+ option to VERIFY_CA or VERIFY_IDENTITY. This option was previously ignored
544
+ for the dbconsole command.
320
545
 
321
546
  *Petrik de Heus*
322
547
 
323
- * `package.json` now uses a strict version constraint for Rails JavaScript packages on new Rails apps.
548
+ * Delegate application record generator description to orm hooked generator.
324
549
 
325
- *Zachary Scott*, *Alex Ghiculescu*
550
+ *Gannon McGibbon*
326
551
 
327
- * Modified scaffold generator template so that running
328
- `rails g scaffold Author` no longer generates tests called "creating
329
- a Author", "updating a Author", and "destroying a Author".
552
+ * Show BCC recipients when present in Action Mailer previews.
330
553
 
331
- Fixes #40744.
554
+ *Akshay Birajdar*
332
555
 
333
- *Michael Duchemin*
556
+ * Extend `routes --grep` to also filter routes by matching against path.
334
557
 
335
- * Raise an error in generators if a field type is invalid.
558
+ Example:
336
559
 
337
- *Petrik de Heus*
560
+ ```bash
561
+ $ bin/rails routes --grep /cats/1
562
+ Prefix Verb URI Pattern Controller#Action
563
+ cat GET /cats/:id(.:format) cats#show
564
+ PATCH /cats/:id(.:format) cats#update
565
+ PUT /cats/:id(.:format) cats#update
566
+ DELETE /cats/:id(.:format) cats#destroy
567
+ ```
338
568
 
339
- * `bin/rails tmp:clear` deletes also files and directories in `tmp/storage`.
569
+ *Orhan Toy*
340
570
 
341
- *George Claghorn*
571
+ * Improve `rails runner` output when given a file path that doesn't exist.
342
572
 
343
- * Fix compatibility with `psych >= 4`.
573
+ *Tekin Suleyman*
574
+
575
+ * `config.allow_concurrency = false` now use a `Monitor` instead of a `Mutex`
344
576
 
345
- Starting in Psych 4.0.0 `YAML.load` behaves like `YAML.safe_load`. To preserve compatibility
346
- `Rails.application.config_for` now uses `YAML.unsafe_load` if available.
577
+ This allows to enable `config.active_support.executor_around_test_case` even
578
+ when `config.allow_concurrency` is disabled.
347
579
 
348
580
  *Jean Boussier*
349
581
 
350
- * Allow loading nested locales in engines.
582
+ * Add `routes --unused` option to detect extraneous routes.
583
+
584
+ Example:
585
+
586
+ ```bash
587
+ $ bin/rails routes --unused
588
+
589
+ Found 2 unused routes:
590
+
591
+ Prefix Verb URI Pattern Controller#Action
592
+ one GET /one(.:format) action#one
593
+ two GET /two(.:format) action#two
594
+ ```
351
595
 
352
596
  *Gannon McGibbon*
353
597
 
354
- * Ensure `Rails.application.config_for` always cast hashes to `ActiveSupport::OrderedOptions`.
598
+ * Add `--parent` option to controller generator to specify parent class of job.
355
599
 
356
- *Jean Boussier*
600
+ Example:
357
601
 
358
- * Remove `Rack::Runtime` from the default middleware stack and deprecate
359
- referencing it in middleware operations without adding it back.
602
+ `bin/rails g controller admin/users --parent=admin_controller` generates:
360
603
 
361
- *Hartley McGuire*
604
+ ```ruby
605
+ class Admin::UsersController < AdminController
606
+ # ...
607
+ end
608
+ ```
609
+
610
+ *Gannon McGibbon*
611
+
612
+ * In-app custom credentials templates are now supported. When a credentials
613
+ file does not exist, `rails credentials:edit` will now try to use
614
+ `lib/templates/rails/credentials/credentials.yml.tt` to generate the
615
+ credentials file, before falling back to the default template.
616
+
617
+ This allows e.g. an open-source Rails app (which would not include encrypted
618
+ credentials files in its repo) to include a credentials template, so that
619
+ users who install the app will get a custom pre-filled credentials file when
620
+ they run `rails credentials:edit`.
621
+
622
+ *Jonathan Hefner*
623
+
624
+ * Except for `dev` and `test` environments, newly generated per-environment
625
+ credentials files (e.g. `config/credentials/production.yml.enc`) now include
626
+ a `secret_key_base` for convenience, just as `config/credentials.yml.enc`
627
+ does.
628
+
629
+ *Jonathan Hefner*
630
+
631
+ * `--no-*` options now work with the app generator's `--minimal` option, and
632
+ are both comprehensive and precise. For example:
633
+
634
+ ```bash
635
+ $ rails new my_cool_app --minimal
636
+ Based on the specified options, the following options will also be activated:
637
+
638
+ --skip-active-job [due to --minimal]
639
+ --skip-action-mailer [due to --skip-active-job, --minimal]
640
+ --skip-active-storage [due to --skip-active-job, --minimal]
641
+ --skip-action-mailbox [due to --skip-active-storage, --minimal]
642
+ --skip-action-text [due to --skip-active-storage, --minimal]
643
+ --skip-javascript [due to --minimal]
644
+ --skip-hotwire [due to --skip-javascript, --minimal]
645
+ --skip-action-cable [due to --minimal]
646
+ --skip-bootsnap [due to --minimal]
647
+ --skip-dev-gems [due to --minimal]
648
+ --skip-system-test [due to --minimal]
649
+
650
+ ...
651
+
652
+ $ rails new my_cool_app --minimal --no-skip-active-storage
653
+ Based on the specified options, the following options will also be activated:
654
+
655
+ --skip-action-mailer [due to --minimal]
656
+ --skip-action-mailbox [due to --minimal]
657
+ --skip-action-text [due to --minimal]
658
+ --skip-javascript [due to --minimal]
659
+ --skip-hotwire [due to --skip-javascript, --minimal]
660
+ --skip-action-cable [due to --minimal]
661
+ --skip-bootsnap [due to --minimal]
662
+ --skip-dev-gems [due to --minimal]
663
+ --skip-system-test [due to --minimal]
664
+
665
+ ...
666
+ ```
667
+
668
+ *Brad Trick* and *Jonathan Hefner*
362
669
 
363
- * Allow adding additional authorized hosts in development via `ENV['RAILS_DEVELOPMENT_HOSTS']`.
670
+ * Add `--skip-dev-gems` option to app generator to skip adding development
671
+ gems (like `web-console`) to the Gemfile.
364
672
 
365
- *Josh Abernathy*, *Debbie Milburn*
673
+ *Brad Trick*
366
674
 
367
- * Add app concern and test keepfiles to generated engine plugins.
675
+ * Skip Active Storage and Action Mailer if Active Job is skipped.
676
+
677
+ *Étienne Barrié*
678
+
679
+ * Correctly check if frameworks are disabled when running app:update.
680
+
681
+ *Étienne Barrié* and *Paulo Barros*
682
+
683
+ * Delegate model generator description to orm hooked generator.
368
684
 
369
685
  *Gannon McGibbon*
370
686
 
371
- * Stop generating a license for in-app plugins.
687
+ * Execute `rails runner` scripts inside the executor.
688
+
689
+ Enables error reporting, query cache, etc.
690
+
691
+ *Jean Boussier*
692
+
693
+ * Avoid booting in development then test for test tasks.
694
+
695
+ Running one of the rails test subtasks (e.g. test:system, test:models) would
696
+ go through Rake and cause the app to be booted twice. Now all the test:*
697
+ subtasks are defined as Thor tasks and directly load the test environment.
698
+
699
+ *Étienne Barrié*
700
+
701
+ * Deprecate `Rails::Generators::Testing::Behaviour` in favor of `Rails::Generators::Testing::Behavior`.
372
702
 
373
703
  *Gannon McGibbon*
374
704
 
375
- * `rails app:update` no longer prompts you to overwrite files that are generally modified in the
376
- course of developing a Rails app. See [#41083](https://github.com/rails/rails/pull/41083) for
377
- the full list of changes.
705
+ * Allow configuration of logger size for local and test environments
378
706
 
379
- *Alex Ghiculescu*
707
+ `config.log_file_size`
380
708
 
381
- * Change default branch for new Rails projects and plugins to `main`.
709
+ Defaults to `100` megabytes.
382
710
 
383
- *Prateek Choudhary*
711
+ *Bernie Chiu*
384
712
 
385
- * The new method `Rails.benchmark` gives you a quick way to measure and log the execution time taken by a block:
713
+ * Enroll new apps in decrypted diffs of credentials by default. This behavior
714
+ can be opted out of with the app generator's `--skip-decrypted-diffs` flag.
386
715
 
387
- def test_expensive_stuff
388
- Rails.benchmark("test_expensive_stuff") { ... }
389
- end
716
+ *Jonathan Hefner*
390
717
 
391
- This functionality was available in some contexts only before.
718
+ * Support declarative-style test name filters with `bin/rails test`.
392
719
 
393
- *Simon Perepelitsa*
720
+ This makes it possible to run a declarative-style test such as:
394
721
 
395
- * Applications generated with `--skip-sprockets` no longer get `app/assets/config/manifest.js` and `app/assets/stylesheets/application.css`.
722
+ ```ruby
723
+ class MyTest < ActiveSupport::TestCase
724
+ test "does something" do
725
+ # ...
726
+ end
727
+ end
728
+ ```
396
729
 
397
- *Cindy Gao*
730
+ Using its declared name:
398
731
 
399
- * Add support for stylesheets and ERB views to `rails stats`.
732
+ ```bash
733
+ $ bin/rails test test/my_test.rb -n "does something"
734
+ ```
400
735
 
401
- *Joel Hawksley*
736
+ Instead of having to specify its expanded method name:
402
737
 
403
- * Allow appended root routes to take precedence over internal welcome controller.
738
+ ```bash
739
+ $ bin/rails test test/my_test.rb -n test_does_something
740
+ ```
404
741
 
405
- *Gannon McGibbon*
742
+ *Jonathan Hefner*
743
+
744
+ * Add `--js` and `--skip-javascript` options to `rails new`
745
+
746
+ `--js` alias to `rails new --javascript ...`
747
+
748
+ Same as `-j`, e.g. `rails new --js esbuild ...`
749
+
750
+ `--skip-js` alias to `rails new --skip-javascript ...`
751
+
752
+ Same as `-J`, e.g. `rails new --skip-js ...`
753
+
754
+ *Dorian Marié*
755
+
756
+ * Allow relative paths with leading dot slash to be passed to `rails test`.
757
+
758
+ Fix `rails test ./test/model/post_test.rb` to run a single test file.
759
+
760
+ *Shouichi Kamiya* and *oljfte*
761
+
762
+ * Deprecate `config.enable_dependency_loading`. This flag addressed a limitation of the `classic` autoloader and has no effect nowadays. To fix this deprecation, please just delete the reference.
763
+
764
+ *Xavier Noria*
765
+
766
+ * 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.
767
+
768
+ *Xavier Noria*
769
+
770
+ * Add JavaScript dependencies installation on bin/setup
771
+
772
+ Add `yarn install` to bin/setup when using esbuild, webpack, or rollout.
773
+
774
+ *Carlos Ribeiro*
775
+
776
+ * Use `controller_class_path` in `Rails::Generators::NamedBase#route_url`
777
+
778
+ The `route_url` method now returns the correct path when generating
779
+ a namespaced controller with a top-level model using `--model-name`.
780
+
781
+ Previously, when running this command:
782
+
783
+ ```bash
784
+ $ bin/rails generate scaffold_controller Admin/Post --model-name Post
785
+ ```
786
+
787
+ the comments above the controller action would look like:
788
+
789
+ ``` ruby
790
+ # GET /posts
791
+ def index
792
+ @posts = Post.all
793
+ end
794
+ ```
795
+
796
+ afterwards, they now look like this:
797
+
798
+ ``` ruby
799
+ # GET /admin/posts
800
+ def index
801
+ @posts = Post.all
802
+ end
803
+ ```
804
+
805
+ Fixes #44662.
806
+
807
+ *Andrew White*
808
+
809
+ * No longer add autoloaded paths to `$LOAD_PATH`.
810
+
811
+ This means it won't be possible to load them with a manual `require` call, the class or module can be referenced instead.
812
+
813
+ Reducing the size of `$LOAD_PATH` speed-up `require` calls for apps not using `bootsnap`, and reduce the
814
+ size of the `bootsnap` cache for the others.
815
+
816
+ *Jean Boussier*
817
+
818
+ * Remove default `X-Download-Options` header
819
+
820
+ This header is currently only used by Internet Explorer which
821
+ will be discontinued in 2022 and since Rails 7 does not fully
822
+ support Internet Explorer this header should not be a default one.
823
+
824
+ *Harun Sabljaković*
825
+
826
+ * Add .node-version files for Rails apps that use Node.js
827
+
828
+ Node version managers that make use of this file:
829
+ https://github.com/shadowspawn/node-version-usage#node-version-file-usage
830
+
831
+ The generated Dockerfile will use the same node version.
406
832
 
833
+ *Sam Ruby*
407
834
 
408
- Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/railties/CHANGELOG.md) for previous changes.
835
+ Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/railties/CHANGELOG.md) for previous changes.