railties 7.0.8.7 → 7.2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +210 -272
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.md +99 -0
  5. data/README.rdoc +4 -4
  6. data/lib/minitest/rails_plugin.rb +67 -1
  7. data/lib/rails/all.rb +1 -3
  8. data/lib/rails/api/task.rb +39 -6
  9. data/lib/rails/application/bootstrap.rb +28 -10
  10. data/lib/rails/application/configuration.rb +228 -72
  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 +50 -33
  14. data/lib/rails/application.rb +117 -76
  15. data/lib/rails/backtrace_cleaner.rb +19 -4
  16. data/lib/rails/cli.rb +5 -3
  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/app/update_command.rb +102 -0
  24. data/lib/rails/commands/application/application_command.rb +2 -0
  25. data/lib/rails/commands/boot/boot_command.rb +14 -0
  26. data/lib/rails/commands/console/console_command.rb +11 -30
  27. data/lib/rails/commands/console/irb_console.rb +146 -0
  28. data/lib/rails/commands/credentials/USAGE +53 -55
  29. data/lib/rails/commands/credentials/credentials_command/diffing.rb +5 -3
  30. data/lib/rails/commands/credentials/credentials_command.rb +64 -70
  31. data/lib/rails/commands/db/system/change/change_command.rb +2 -1
  32. data/lib/rails/commands/dbconsole/dbconsole_command.rb +32 -131
  33. data/lib/rails/commands/destroy/destroy_command.rb +3 -2
  34. data/lib/rails/commands/dev/dev_command.rb +1 -6
  35. data/lib/rails/commands/devcontainer/devcontainer_command.rb +39 -0
  36. data/lib/rails/commands/encrypted/USAGE +15 -20
  37. data/lib/rails/commands/encrypted/encrypted_command.rb +46 -35
  38. data/lib/rails/commands/gem_help/USAGE +16 -0
  39. data/lib/rails/commands/gem_help/gem_help_command.rb +13 -0
  40. data/lib/rails/commands/generate/generate_command.rb +2 -2
  41. data/lib/rails/commands/help/USAGE +13 -13
  42. data/lib/rails/commands/help/help_command.rb +21 -2
  43. data/lib/rails/commands/initializers/initializers_command.rb +1 -4
  44. data/lib/rails/commands/middleware/middleware_command.rb +17 -0
  45. data/lib/rails/commands/new/new_command.rb +2 -0
  46. data/lib/rails/commands/notes/notes_command.rb +2 -1
  47. data/lib/rails/commands/plugin/plugin_command.rb +2 -0
  48. data/lib/rails/commands/rake/rake_command.rb +25 -22
  49. data/lib/rails/commands/restart/restart_command.rb +14 -0
  50. data/lib/rails/commands/routes/routes_command.rb +13 -1
  51. data/lib/rails/commands/runner/USAGE +14 -12
  52. data/lib/rails/commands/runner/runner_command.rb +42 -19
  53. data/lib/rails/commands/secret/secret_command.rb +13 -0
  54. data/lib/rails/commands/server/server_command.rb +37 -34
  55. data/lib/rails/commands/test/USAGE +14 -0
  56. data/lib/rails/commands/test/test_command.rb +58 -14
  57. data/lib/rails/commands/unused_routes/unused_routes_command.rb +75 -0
  58. data/lib/rails/commands/version/version_command.rb +1 -0
  59. data/lib/rails/configuration.rb +15 -6
  60. data/lib/rails/console/app.rb +5 -35
  61. data/lib/rails/console/helpers.rb +5 -16
  62. data/lib/rails/console/methods.rb +23 -0
  63. data/lib/rails/deprecator.rb +7 -0
  64. data/lib/rails/engine/configuration.rb +50 -6
  65. data/lib/rails/engine.rb +53 -25
  66. data/lib/rails/gem_version.rb +4 -4
  67. data/lib/rails/generators/actions.rb +6 -15
  68. data/lib/rails/generators/active_model.rb +28 -14
  69. data/lib/rails/generators/app_base.rb +382 -88
  70. data/lib/rails/generators/app_name.rb +3 -14
  71. data/lib/rails/generators/base.rb +21 -9
  72. data/lib/rails/generators/database.rb +231 -35
  73. data/lib/rails/generators/erb/mailer/templates/layout.html.erb.tt +1 -1
  74. data/lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt +2 -0
  75. data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +2 -0
  76. data/lib/rails/generators/erb/scaffold/templates/new.html.erb.tt +2 -0
  77. data/lib/rails/generators/generated_attribute.rb +38 -1
  78. data/lib/rails/generators/migration.rb +4 -5
  79. data/lib/rails/generators/model_helpers.rb +2 -1
  80. data/lib/rails/generators/rails/app/USAGE +22 -6
  81. data/lib/rails/generators/rails/app/app_generator.rb +135 -86
  82. data/lib/rails/generators/rails/app/templates/Dockerfile.tt +110 -0
  83. data/lib/rails/generators/rails/app/templates/Gemfile.tt +19 -21
  84. data/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt +4 -0
  85. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +8 -1
  86. data/lib/rails/generators/rails/app/templates/app/views/layouts/mailer.html.erb.tt +1 -1
  87. data/lib/rails/generators/rails/app/templates/app/views/pwa/manifest.json.erb.tt +22 -0
  88. data/lib/rails/generators/rails/app/templates/app/views/pwa/service-worker.js +26 -0
  89. data/lib/rails/generators/rails/app/templates/bin/brakeman.tt +6 -0
  90. data/lib/rails/generators/rails/app/templates/bin/rubocop.tt +7 -0
  91. data/lib/rails/generators/rails/app/templates/bin/setup.tt +15 -2
  92. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +6 -17
  93. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +3 -3
  94. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +11 -6
  95. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +10 -3
  96. data/lib/rails/generators/rails/app/templates/config/databases/{jdbcmysql.yml.tt → trilogy.yml.tt} +12 -7
  97. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +25 -8
  98. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +40 -28
  99. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +20 -13
  100. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +3 -1
  101. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +2 -2
  102. data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +1 -1
  103. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +4 -4
  104. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt +70 -0
  105. data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +11 -9
  106. data/lib/rails/generators/rails/app/templates/config/locales/en.yml +11 -13
  107. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +25 -34
  108. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +11 -1
  109. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +6 -4
  110. data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +15 -0
  111. data/lib/rails/generators/rails/app/templates/dockerignore.tt +56 -0
  112. data/lib/rails/generators/rails/app/templates/github/ci.yml.tt +138 -0
  113. data/lib/rails/generators/rails/app/templates/github/dependabot.yml +12 -0
  114. data/lib/rails/generators/rails/app/templates/gitignore.tt +7 -11
  115. data/lib/rails/generators/rails/app/templates/node-version.tt +1 -0
  116. data/lib/rails/generators/rails/app/templates/public/406-unsupported-browser.html +66 -0
  117. data/lib/rails/generators/rails/app/templates/public/icon.png +0 -0
  118. data/lib/rails/generators/rails/app/templates/public/icon.svg +3 -0
  119. data/lib/rails/generators/rails/app/templates/rubocop.yml.tt +8 -0
  120. data/lib/rails/generators/rails/app/templates/test/application_system_test_case.rb.tt +1 -1
  121. data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +10 -8
  122. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +9 -7
  123. data/lib/rails/generators/rails/application_record/application_record_generator.rb +4 -0
  124. data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +2 -1
  125. data/lib/rails/generators/rails/controller/USAGE +12 -4
  126. data/lib/rails/generators/rails/controller/controller_generator.rb +6 -1
  127. data/lib/rails/generators/rails/controller/templates/controller.rb.tt +1 -1
  128. data/lib/rails/generators/rails/credentials/credentials_generator.rb +29 -24
  129. data/lib/rails/generators/rails/credentials/templates/credentials.yml.tt +8 -0
  130. data/lib/rails/generators/rails/db/system/change/change_generator.rb +146 -5
  131. data/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb +166 -0
  132. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/Dockerfile.tt +3 -0
  133. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/compose.yaml.tt +47 -0
  134. data/lib/rails/generators/rails/devcontainer/templates/devcontainer/devcontainer.json.tt +37 -0
  135. data/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +1 -2
  136. data/lib/rails/generators/rails/migration/USAGE +21 -11
  137. data/lib/rails/generators/rails/migration/migration_generator.rb +4 -0
  138. data/lib/rails/generators/rails/model/model_generator.rb +4 -0
  139. data/lib/rails/generators/rails/plugin/USAGE +17 -6
  140. data/lib/rails/generators/rails/plugin/plugin_generator.rb +45 -22
  141. data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +2 -2
  142. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +7 -3
  143. data/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt +1 -1
  144. data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +2 -0
  145. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +1 -17
  146. data/lib/rails/generators/rails/plugin/templates/bin/rubocop.tt +7 -0
  147. data/lib/rails/generators/rails/plugin/templates/github/ci.yml.tt +103 -0
  148. data/lib/rails/generators/rails/plugin/templates/github/dependabot.yml +12 -0
  149. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +0 -2
  150. data/lib/rails/generators/rails/plugin/templates/rubocop.yml.tt +8 -0
  151. data/lib/rails/generators/rails/plugin/templates/test/application_system_test_case.rb.tt +1 -1
  152. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +5 -5
  153. data/lib/rails/generators/rails/resource/resource_generator.rb +6 -0
  154. data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +2 -1
  155. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +1 -1
  156. data/lib/rails/generators/test_case.rb +2 -2
  157. data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +6 -4
  158. data/lib/rails/generators/test_unit/mailer/templates/preview.rb.tt +3 -2
  159. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +16 -2
  160. data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +2 -2
  161. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +2 -2
  162. data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +2 -0
  163. data/lib/rails/generators/test_unit/system/templates/application_system_test_case.rb.tt +1 -1
  164. data/lib/rails/generators/testing/assertions.rb +20 -0
  165. data/lib/rails/generators/testing/{behaviour.rb → behavior.rb} +8 -4
  166. data/lib/rails/generators.rb +12 -16
  167. data/lib/rails/health_controller.rb +55 -0
  168. data/lib/rails/info.rb +3 -3
  169. data/lib/rails/info_controller.rb +33 -11
  170. data/lib/rails/mailers_controller.rb +29 -6
  171. data/lib/rails/paths.rb +15 -12
  172. data/lib/rails/pwa_controller.rb +15 -0
  173. data/lib/rails/rack/logger.rb +27 -16
  174. data/lib/rails/rackup/server.rb +15 -0
  175. data/lib/rails/railtie/configurable.rb +2 -2
  176. data/lib/rails/railtie/configuration.rb +14 -1
  177. data/lib/rails/railtie.rb +33 -34
  178. data/lib/rails/source_annotation_extractor.rb +67 -18
  179. data/lib/rails/tasks/engine.rake +8 -8
  180. data/lib/rails/tasks/framework.rake +2 -34
  181. data/lib/rails/tasks/log.rake +1 -1
  182. data/lib/rails/tasks/misc.rake +3 -14
  183. data/lib/rails/tasks/statistics.rake +5 -4
  184. data/lib/rails/tasks/tmp.rake +6 -6
  185. data/lib/rails/tasks/zeitwerk.rake +15 -35
  186. data/lib/rails/tasks.rb +0 -2
  187. data/lib/rails/templates/layouts/application.html.erb +1 -1
  188. data/lib/rails/templates/rails/mailers/email.html.erb +44 -8
  189. data/lib/rails/templates/rails/mailers/index.html.erb +14 -7
  190. data/lib/rails/templates/rails/mailers/mailer.html.erb +11 -5
  191. data/lib/rails/templates/rails/welcome/index.html.erb +5 -2
  192. data/lib/rails/test_help.rb +11 -18
  193. data/lib/rails/test_unit/line_filtering.rb +1 -1
  194. data/lib/rails/test_unit/reporter.rb +14 -4
  195. data/lib/rails/test_unit/runner.rb +62 -20
  196. data/lib/rails/test_unit/test_parser.rb +133 -0
  197. data/lib/rails/test_unit/testing.rake +13 -33
  198. data/lib/rails/testing/maintain_test_schema.rb +16 -0
  199. data/lib/rails/version.rb +1 -1
  200. data/lib/rails/zeitwerk_checker.rb +15 -0
  201. data/lib/rails.rb +20 -17
  202. metadata +87 -40
  203. data/RDOC_MAIN.rdoc +0 -97
  204. data/lib/rails/app_updater.rb +0 -40
  205. data/lib/rails/application/dummy_erb_compiler.rb +0 -18
  206. data/lib/rails/commands/secrets/USAGE +0 -66
  207. data/lib/rails/commands/secrets/secrets_command.rb +0 -65
  208. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +0 -68
  209. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +0 -70
  210. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +0 -24
  211. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +0 -62
  212. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +0 -53
  213. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt +0 -143
  214. data/lib/rails/generators/rails/app/templates/public/apple-touch-icon-precomposed.png +0 -0
  215. data/lib/rails/generators/rails/app/templates/public/apple-touch-icon.png +0 -0
  216. data/lib/rails/generators/rails/app/templates/public/favicon.ico +0 -0
  217. data/lib/rails/generators/rails/model/USAGE +0 -113
  218. data/lib/rails/ruby_version_check.rb +0 -15
  219. data/lib/rails/secrets.rb +0 -110
  220. data/lib/rails/tasks/middleware.rake +0 -9
  221. data/lib/rails/tasks/restart.rake +0 -9
data/CHANGELOG.md CHANGED
@@ -1,443 +1,381 @@
1
- ## Rails 7.0.8.7 (December 10, 2024) ##
1
+ ## Rails 7.2.2.1 (December 10, 2024) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 7.0.8.6 (October 23, 2024) ##
6
+ ## Rails 7.2.2 (October 30, 2024) ##
7
7
 
8
8
  * No changes.
9
9
 
10
10
 
11
- ## Rails 7.0.8.5 (October 15, 2024) ##
11
+ ## Rails 7.2.1.2 (October 23, 2024) ##
12
12
 
13
13
  * No changes.
14
14
 
15
15
 
16
- ## Rails 7.0.8.4 (June 04, 2024) ##
16
+ ## Rails 7.2.1.1 (October 15, 2024) ##
17
17
 
18
18
  * No changes.
19
19
 
20
20
 
21
- ## Rails 7.0.8.3 (May 17, 2024) ##
21
+ ## Rails 7.2.1 (August 22, 2024) ##
22
22
 
23
- * No changes.
23
+ * Fix `rails console` for application with non default application constant.
24
24
 
25
+ The wrongly assumed the Rails application would be named `AppNamespace::Application`,
26
+ which is the default but not an obligation.
25
27
 
26
- ## Rails 7.0.8.2 (May 16, 2024) ##
28
+ *Jean Boussier*
27
29
 
28
- * No changes.
30
+ * Fix the default Dockerfile to include the full sqlite3 package.
29
31
 
32
+ Prior to this it only included `libsqlite3`, so it wasn't enough to
33
+ run `rails dbconsole`.
30
34
 
31
- ## Rails 7.0.8.1 (February 21, 2024) ##
35
+ *Jerome Dalbert*
32
36
 
33
- * No changes.
37
+ * Don't update public directory during `app:update` command for API-only Applications.
34
38
 
39
+ *y-yagi*
35
40
 
36
- ## Rails 7.0.8 (September 09, 2023) ##
41
+ * Don't add bin/brakeman if brakeman is not in bundle when upgrading an application.
37
42
 
38
- * Omit `webdrivers` gem dependency from `Gemfile` template
43
+ *Etienne Barrié*
39
44
 
40
- *Sean Doyle*
41
-
42
- ## Rails 7.0.7.2 (August 22, 2023) ##
45
+ * Remove PWA views and routes if its an API only project.
43
46
 
44
- * No changes.
47
+ *Jean Boussier*
45
48
 
49
+ * Simplify generated Puma configuration
46
50
 
47
- ## Rails 7.0.7.1 (August 22, 2023) ##
51
+ *DHH*, *Rafael Mendonça França*
48
52
 
49
- * No changes.
50
53
 
54
+ ## Rails 7.2.0 (August 09, 2024) ##
51
55
 
52
- ## Rails 7.0.7 (August 09, 2023) ##
56
+ * The new `bin/rails boot` command boots the application and exits. Supports the
57
+ standard `-e/--environment` options.
53
58
 
54
- * Update default scaffold templates to set 303 (See Other) as status code
55
- on redirect for the update action for XHR requests other than GET or POST
56
- to avoid issues (e.g browsers trying to follow the redirect using the
57
- original request method resulting in double PATCH/PUT)
59
+ *Xavier Noria*
58
60
 
59
- *Guillermo Iguaran*
61
+ * Create a Dev Container Generator that generates a Dev Container setup based on the current configuration
62
+ of the application. Usage:
60
63
 
64
+ `bin/rails devcontainer`
61
65
 
62
- ## Rails 7.0.6 (June 29, 2023) ##
63
- * Avoid escaping paths when editing credentials.
66
+ *Andrew Novoselac*
64
67
 
65
- *Jonathan Hefner*
68
+ * Add Rubocop and GitHub Actions to plugin generator.
69
+ This can be skipped using --skip-rubocop and --skip-ci.
66
70
 
71
+ *Chris Oliver*
67
72
 
68
- ## Rails 7.0.5.1 (June 26, 2023) ##
73
+ * Remove support for `oracle`, `sqlserver` and JRuby specific database adapters from the
74
+ `rails new` and `rails db:system:change` commands.
69
75
 
70
- * No changes.
76
+ The supported options are `sqlite3`, `mysql`, `postgresql` and `trilogy`.
71
77
 
78
+ *Andrew Novoselac*
72
79
 
73
- ## Rails 7.0.5 (May 24, 2023) ##
80
+ * Add options to `bin/rails app:update`.
74
81
 
75
- * Add puma app server to Gemfile in order to start test/dummy.
82
+ `bin/rails app:update` now supports the same generic options that generators do:
76
83
 
77
- *Donapieppo*
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
78
88
 
79
- * Rails console now disables `IRB`'s autocompletion feature in production by default.
89
+ *Étienne Barrié*
80
90
 
81
- Setting `IRB_USE_AUTOCOMPLETE=true` can override this default.
91
+ * Implement Rails console commands and helpers with IRB v1.13's extension APIs.
82
92
 
83
- *Stan Lo*
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.
84
96
 
85
- * Send 303 See Other status code back for the destroy action on newly generated
86
- scaffold controllers.
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.
87
99
 
88
- *Tony Drake*
100
+ *Stan Lo*
89
101
 
102
+ * Remove deprecated `Rails::Generators::Testing::Behaviour`.
90
103
 
91
- ## Rails 7.0.4.3 (March 13, 2023) ##
104
+ *Rafael Mendonça França*
92
105
 
93
- * No changes.
106
+ * Remove deprecated `find_cmd_and_exec` console helper.
94
107
 
108
+ *Rafael Mendonça França*
95
109
 
96
- ## Rails 7.0.4.2 (January 24, 2023) ##
110
+ * Remove deprecated `Rails.config.enable_dependency_loading`.
97
111
 
98
- * No changes.
112
+ *Rafael Mendonça França*
99
113
 
114
+ * Remove deprecated `Rails.application.secrets`.
100
115
 
101
- ## Rails 7.0.4.1 (January 17, 2023) ##
116
+ *Rafael Mendonça França*
102
117
 
103
- * No changes.
118
+ * Generated Gemfile will include `require: "debug/prelude"` for the `debug` gem.
104
119
 
120
+ Requiring `debug` gem directly automatically activates it, which could introduce
121
+ additional overhead and memory usage even without entering a debugging session.
105
122
 
106
- ## Rails 7.0.4 (September 09, 2022) ##
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.
107
126
 
108
- * `config.allow_concurrency = false` now use a `Monitor` instead of a `Mutex`
127
+ *Stan Lo*
109
128
 
110
- This allows to enable `config.active_support.executor_around_test_case` even
111
- when `config.allow_concurrency` is disabled.
129
+ * Skip generating a `test` job in ci.yml when a new application is generated with the
130
+ `--skip-test` option.
112
131
 
113
- *Jean Boussier*
132
+ *Steve Polito*
114
133
 
115
- * Skip Active Storage and Action Mailer if Active Job is skipped.
134
+ * Update the `.node-version` file conditionally generated for new applications to 20.11.1
116
135
 
117
- *Étienne Barrié*
136
+ *Steve Polito*
118
137
 
119
- * Correctly check if frameworks are disabled when running app:update.
138
+ * Fix sanitizer vendor configuration in 7.1 defaults.
120
139
 
121
- *Étienne Barrié* and *Paulo Barros*
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.
122
142
 
123
- * Fixed `config.active_support.cache_format_version` never being applied.
143
+ *Mike Dalessio*, *Rafael Mendonça França*
124
144
 
125
- Rails 7.0 shipped with a new serializer for Rails.cache, but the associated config
126
- wasn't working properly. Note that even after this fix, it can only be applied from
127
- the `application.rb` file.
145
+ * Set `action_mailer.default_url_options` values in `development` and `test`.
128
146
 
129
- *Alex Ghiculescu*
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.
130
149
 
150
+ *Steve Polito*
131
151
 
132
- ## Rails 7.0.3.1 (July 12, 2022) ##
152
+ * Introduce `Rails::Generators::Testing::Assertions#assert_initializer`.
133
153
 
134
- * No changes.
154
+ Compliments the existing `initializer` generator action.
135
155
 
156
+ ```rb
157
+ assert_initializer "mail_interceptors.rb"
158
+ ```
136
159
 
137
- ## Rails 7.0.3 (May 09, 2022) ##
160
+ *Steve Polito*
138
161
 
139
- * If reloading and eager loading are both enabled, after a reload Rails eager loads again the application code.
162
+ * Generate a .devcontainer folder and its contents when creating a new app.
140
163
 
141
- *Xavier Noria*
164
+ The .devcontainer folder includes everything needed to boot the app and do development in a remote container.
142
165
 
143
- * Use `controller_class_path` in `Rails::Generators::NamedBase#route_url`
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
144
171
 
145
- The `route_url` method now returns the correct path when generating
146
- a namespaced controller with a top-level model using `--model-name`.
172
+ If any of these options are skipped in the app setup they will not be included in the container configuration.
147
173
 
148
- Previously, when running this command:
174
+ These files can be skipped using the `--skip-devcontainer` option.
149
175
 
150
- ``` sh
151
- bin/rails generate scaffold_controller Admin/Post --model-name Post
152
- ```
176
+ *Andrew Novoselac & Rafael Mendonça França*
153
177
 
154
- the comments above the controller action would look like:
178
+ * Introduce `SystemTestCase#served_by` for configuring the System Test application server.
155
179
 
156
- ``` ruby
157
- # GET /posts
158
- def index
159
- @posts = Post.all
160
- end
161
- ```
162
-
163
- afterwards, they now look like this:
180
+ By default this is localhost. This method allows the host and port to be specified manually.
164
181
 
165
- ``` ruby
166
- # GET /admin/posts
167
- def index
168
- @posts = Post.all
182
+ ```ruby
183
+ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
184
+ served_by host: "testserver", port: 45678
169
185
  end
170
186
  ```
171
187
 
172
- Fixes #44662.
173
-
174
- *Andrew White*
175
-
176
- ## Rails 7.0.2.4 (April 26, 2022) ##
177
-
178
- * No changes.
179
-
180
-
181
- ## Rails 7.0.2.3 (March 08, 2022) ##
182
-
183
- * No changes.
184
-
185
-
186
- ## Rails 7.0.2.2 (February 11, 2022) ##
187
-
188
- * No changes.
189
-
190
-
191
- ## Rails 7.0.2.1 (February 11, 2022) ##
192
-
193
- * No changes.
194
-
195
-
196
- ## Rails 7.0.2 (February 08, 2022) ##
197
-
198
- * No changes.
199
-
200
-
201
- ## Rails 7.0.1 (January 06, 2022) ##
202
-
203
- * Prevent duplicate entries in plugin Gemfile.
204
-
205
- *Jonathan Hefner*
206
-
207
- * Fix asset pipeline errors for plugin dummy apps.
208
-
209
- *Jonathan Hefner*
188
+ *Andrew Novoselac & Rafael Mendonça França*
210
189
 
211
- * Fix generated route revocation.
190
+ * `bin/rails test` will no longer load files named `*_test.rb` if they are located in the `fixtures` folder.
212
191
 
213
- *Jonathan Hefner*
192
+ *Edouard Chin*
214
193
 
215
- * Addresses an issue in which Sidekiq jobs could not reload certain
216
- namespaces.
217
-
218
- See [fxn/zeitwerk#198](https://github.com/fxn/zeitwerk/issues/198) for
219
- details.
220
-
221
- *Xavier Noria*
222
-
223
- * Fix plugin generator to a plugin that pass all the tests.
224
-
225
- *Rafael Mendonça França*
194
+ * Ensure logger tags configured with `config.log_tags` are still active in `request.action_dispatch` handlers.
226
195
 
196
+ *KJ Tsanaktsidis*
227
197
 
228
- ## Rails 7.0.0 (December 15, 2021) ##
198
+ * Setup jemalloc in the default Dockerfile for memory optimization.
229
199
 
230
- * No changes.
200
+ *Matt Almeida*, *Jean Boussier*
231
201
 
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.
232
204
 
233
- ## Rails 7.0.0.rc3 (December 14, 2021) ##
205
+ *Willian Tenfen*
234
206
 
235
- * Allow localhost with a port by default in development
207
+ * Skip CSS when generating APIs.
236
208
 
237
- [Fixes: #43864]
209
+ *Ruy Rocha*
238
210
 
239
- ## Rails 7.0.0.rc2 (December 14, 2021) ##
211
+ * Rails console now indicates application name and the current Rails environment:
240
212
 
241
- * No changes
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
218
+ ```
242
219
 
243
- ## Rails 7.0.0.rc1 (December 06, 2021) ##
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.
244
222
 
245
- * Remove deprecated `config` in `dbconsole`.
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.
246
226
 
247
- *Rafael Mendonça França*
227
+ *Stan Lo*
248
228
 
249
- * Change default `X-XSS-Protection` header to disable XSS auditor
229
+ * Ensure `autoload_paths`, `autoload_once_paths`, `eager_load_paths`, and
230
+ `load_paths` only have directories when initialized from engine defaults.
250
231
 
251
- This header has been deprecated and the XSS auditor it triggered
252
- has been removed from all major modern browsers (in favour of
253
- Content Security Policy) that implemented this header to begin with
254
- (Firefox never did).
232
+ Previously, files under the `app` directory could end up there too.
255
233
 
256
- [OWASP](https://owasp.org/www-project-secure-headers/#x-xss-protection)
257
- suggests setting this header to '0' to disable the default behaviour
258
- on old browsers as it can introduce additional security issues.
234
+ *Takumasa Ochi*
259
235
 
260
- Added the new behaviour as a framework default from Rails 7.0.
236
+ * Prevent unnecessary application reloads in development.
261
237
 
262
- *Christian Sutter*
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.
263
241
 
264
- * Scaffolds now use date_field, time_field and datetime_field instead of
265
- date_select, time_select and datetime_select; thus providing native date/time pickers.
242
+ *Takumasa Ochi*
266
243
 
267
- *Martijn Lafeber*
244
+ * Use `oven-sh/setup-bun` in GitHub CI when generating an app with Bun.
268
245
 
269
- * Fix a regression in which autoload paths were initialized too late.
246
+ *TangRufus*
270
247
 
271
- *Xavier Noria*
248
+ * Disable `pidfile` generation in the `production` environment.
272
249
 
273
- ## Rails 7.0.0.alpha2 (September 15, 2021) ##
250
+ *Hans Schnedlitz*
274
251
 
275
- * Fix activestorage dependency in the npm package.
252
+ * Set `config.action_view.annotate_rendered_view_with_filenames` to `true` in
253
+ the `development` environment.
276
254
 
277
- *Rafael Mendonça França*
255
+ *Adrian Marin*
278
256
 
279
- ## Rails 7.0.0.alpha1 (September 15, 2021) ##
257
+ * Support the `BACKTRACE` environment variable to turn off backtrace cleaning.
280
258
 
281
- * New and upgraded Rails apps no longer generate `config/initializers/application_controller_renderer.rb`
282
- or `config/initializers/cookies_serializer.rb`
259
+ Useful for debugging framework code:
283
260
 
284
- The default value for `cookies_serializer` (`:json`) has been moved to `config.load_defaults("7.0")`.
285
- The new framework defaults file can be used to upgrade the serializer.
261
+ ```sh
262
+ BACKTRACE=1 bin/rails server
263
+ ```
286
264
 
287
265
  *Alex Ghiculescu*
288
266
 
289
- * New applications get a dependency on the new `debug` gem, replacing `byebug`.
290
-
291
- *Xavier Noria*
292
-
293
- * Add SSL support for postgresql in `bin/rails dbconsole`.
294
-
295
- Fixes #43114.
296
-
297
- *Michael Bayucot*
298
-
299
- * Add support for comments above gem declaration in Rails application templates, e.g. `gem("nokogiri", comment: "For XML")`.
267
+ * Raise `ArgumentError` when reading `config.x.something` with arguments:
300
268
 
301
- *Linas Juškevičius*
302
-
303
- * The setter `config.autoloader=` has been deleted. `zeitwerk` is the only
304
- available autoloading mode.
305
-
306
- *Xavier Noria*
307
-
308
- * `config.autoload_once_paths` can be configured in the body of the
309
- application class defined in `config/application.rb` or in the configuration
310
- for environments in `config/environments/*`.
311
-
312
- Similarly, engines can configure that collection in the class body of the
313
- engine class or in the configuration for environments.
314
-
315
- After that, the collection is frozen, and you can autoload from those paths.
316
- They are managed by the `Rails.autoloaders.once` autoloader, which does not
317
- reload, only autoloads/eager loads.
318
-
319
- *Xavier Noria*
320
-
321
- * During initialization, you cannot autoload reloadable classes or modules
322
- like application models, unless they are wrapped in a `to_prepare` block.
323
- For example, from `config/initializers/*`, or in application, engines, or
324
- railties initializers.
325
-
326
- Please check the [autoloading
327
- guide](https://guides.rubyonrails.org/v7.0/autoloading_and_reloading_constants.html#autoloading-when-the-application-boots)
328
- for details.
329
-
330
- *Xavier Noria*
331
-
332
- * While they are allowed to have elements in common, it is no longer required
333
- that `config.autoload_once_paths` is a subset of `config.autoload_paths`.
334
- The former are managed by the `once` autoloader. The `main` autoloader
335
- manages the latter minus the former.
336
-
337
- *Xavier Noria*
269
+ ```ruby
270
+ config.x.this_works.this_raises true # raises ArgumentError
271
+ ```
338
272
 
339
- * Show Rake task description if command is run with `-h`.
273
+ *Sean Doyle*
340
274
 
341
- Adding `-h` (or `--help`) to a Rails command that's a Rake task now outputs
342
- the task description instead of the general Rake help.
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.
343
276
 
344
- *Petrik de Heus*
277
+ *DHH*
345
278
 
346
- * Add missing `plugin new` command to help.
279
+ * Updated system tests to now use headless Chrome by default for the new applications.
347
280
 
348
- *Petrik de Heus
281
+ *DHH*
349
282
 
350
- * Fix `config_for` error when there's only a shared root array.
283
+ * Add GitHub CI files for Dependabot, Brakeman, RuboCop, and running tests by default. Can be skipped with `--skip-ci`.
351
284
 
352
- *Loïc Delmaire*
285
+ *DHH*
353
286
 
354
- * Raise an error in generators if an index type is invalid.
287
+ * Add Brakeman by default for static analysis of security vulnerabilities. Allow skipping with `--skip-brakeman option`.
355
288
 
356
- *Petrik de Heus*
289
+ *vipulnsward*
357
290
 
358
- * `package.json` now uses a strict version constraint for Rails JavaScript packages on new Rails apps.
291
+ * Add RuboCop with rules from `rubocop-rails-omakase` by default. Skip with `--skip-rubocop`.
359
292
 
360
- *Zachary Scott*, *Alex Ghiculescu*
293
+ *DHH* and *zzak*
361
294
 
362
- * Modified scaffold generator template so that running
363
- `rails g scaffold Author` no longer generates tests called "creating
364
- a Author", "updating a Author", and "destroying a Author".
295
+ * Use `bin/rails runner --skip-executor` to not wrap the runner script with an
296
+ Executor.
365
297
 
366
- Fixes #40744.
298
+ *Ben Sheldon*
367
299
 
368
- *Michael Duchemin*
300
+ * Fix isolated engines to take `ActiveRecord::Base.table_name_prefix` into consideration.
369
301
 
370
- * Raise an error in generators if a field type is invalid.
302
+ This will allow for engine defined models, such as inside Active Storage, to respect
303
+ Active Record table name prefix configuration.
371
304
 
372
- *Petrik de Heus*
305
+ *Chedli Bourguiba*
373
306
 
374
- * `bin/rails tmp:clear` deletes also files and directories in `tmp/storage`.
307
+ * Fix running `db:system:change` when the app has no Dockerfile.
375
308
 
376
- *George Claghorn*
309
+ *Hartley McGuire*
377
310
 
378
- * Fix compatibility with `psych >= 4`.
311
+ * In Action Mailer previews, list inline attachments separately from normal
312
+ attachments.
379
313
 
380
- Starting in Psych 4.0.0 `YAML.load` behaves like `YAML.safe_load`. To preserve compatibility
381
- `Rails.application.config_for` now uses `YAML.unsafe_load` if available.
314
+ For example, attachments that were previously listed like
382
315
 
383
- *Jean Boussier*
316
+ > Attachments: logo.png file1.pdf file2.pdf
384
317
 
385
- * Allow loading nested locales in engines.
318
+ will now be listed like
386
319
 
387
- *Gannon McGibbon*
320
+ > Attachments: file1.pdf file2.pdf (Inline: logo.png)
388
321
 
389
- * Ensure `Rails.application.config_for` always cast hashes to `ActiveSupport::OrderedOptions`.
322
+ *Christian Schmidt* and *Jonathan Hefner*
390
323
 
391
- *Jean Boussier*
324
+ * In mailer preview, only show SMTP-To if it differs from the union of To, Cc and Bcc.
392
325
 
393
- * Remove `Rack::Runtime` from the default middleware stack and deprecate
394
- referencing it in middleware operations without adding it back.
326
+ *Christian Schmidt*
395
327
 
396
- *Hartley McGuire*
328
+ * Enable YJIT by default on new applications running Ruby 3.3+.
397
329
 
398
- * Allow adding additional authorized hosts in development via `ENV['RAILS_DEVELOPMENT_HOSTS']`.
330
+ This can be disabled by setting `Rails.application.config.yjit = false`
399
331
 
400
- *Josh Abernathy*, *Debbie Milburn*
332
+ *Jean Boussier*, *Rafael Mendonça França*
401
333
 
402
- * Add app concern and test keepfiles to generated engine plugins.
334
+ * In Action Mailer previews, show date from message `Date` header if present.
403
335
 
404
- *Gannon McGibbon*
336
+ *Sampat Badhe*
405
337
 
406
- * Stop generating a license for in-app plugins.
338
+ * Exit with non-zero status when the migration generator fails.
407
339
 
408
- *Gannon McGibbon*
340
+ *Katsuhiko YOSHIDA*
409
341
 
410
- * `rails app:update` no longer prompts you to overwrite files that are generally modified in the
411
- course of developing a Rails app. See [#41083](https://github.com/rails/rails/pull/41083) for
412
- the full list of changes.
342
+ * Use numeric UID and GID in Dockerfile template.
413
343
 
414
- *Alex Ghiculescu*
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:
415
346
 
416
- * Change default branch for new Rails projects and plugins to `main`.
347
+ ```
348
+ container has runAsNonRoot and image has non-numeric user (rails), cannot verify user is non-root
349
+ ```
417
350
 
418
- *Prateek Choudhary*
351
+ This change sets default user and group by their numeric values.
419
352
 
420
- * The new method `Rails.benchmark` gives you a quick way to measure and log the execution time taken by a block:
353
+ *Ivan Fedotov*
421
354
 
422
- def test_expensive_stuff
423
- Rails.benchmark("test_expensive_stuff") { ... }
424
- end
355
+ * Disallow invalid values for rails new options.
425
356
 
426
- This functionality was available in some contexts only before.
357
+ The `--database`, `--asset-pipeline`, `--css`, and `--javascript` options
358
+ for `rails new` take different arguments. This change validates them.
427
359
 
428
- *Simon Perepelitsa*
360
+ *Tony Drake*, *Akhil G Krishnan*, *Petrik de Heus*
429
361
 
430
- * Applications generated with `--skip-sprockets` no longer get `app/assets/config/manifest.js` and `app/assets/stylesheets/application.css`.
362
+ * Conditionally print `$stdout` when invoking `run_generator`.
431
363
 
432
- *Cindy Gao*
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.
433
367
 
434
- * Add support for stylesheets and ERB views to `rails stats`.
368
+ This allows for calls to `binding.irb` and `puts` work as expected.
435
369
 
436
- *Joel Hawksley*
370
+ ```sh
371
+ RAILS_LOG_TO_STDOUT=true ./bin/test test/generators/actions_test.rb
372
+ ```
437
373
 
438
- * Allow appended root routes to take precedence over internal welcome controller.
374
+ *Steve Polito*
439
375
 
440
- *Gannon McGibbon*
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.
441
378
 
379
+ *Adrian Hirt*
442
380
 
443
- Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-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.