railties 7.1.0 → 7.2.2.1

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