railties 7.0.5 → 7.1.3.4

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