railties 7.0.8 → 7.2.0

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 +188 -268
  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 +110 -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 +93 -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 +137 -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 +51 -23
  66. data/lib/rails/gem_version.rb +3 -3
  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 +132 -82
  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 +37 -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 +2 -0
  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 +24 -34
  108. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +9 -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 +43 -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 +4 -4
  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 +7 -15
  167. data/lib/rails/health_controller.rb +55 -0
  168. data/lib/rails/info.rb +3 -3
  169. data/lib/rails/info_controller.rb +31 -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 +20 -21
  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 +89 -42
  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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '039b80e88b28979daa3d0245fae1abb2b8745a8ab9a201f546980d24be671464'
4
- data.tar.gz: '02748eb13c60203b519ecdfde3c5ce27246b8b3b331920ead5c76a11189a0e07'
3
+ metadata.gz: bfbc258d03c709473511d240ffab0b5bbb1b0f439158c768c113054dea8d296a
4
+ data.tar.gz: 9640e2920bd9ada2cec2f8d684ddcb40f778be9a44dba03be29b5db3fb820b97
5
5
  SHA512:
6
- metadata.gz: c88e5f59851ad2eb35a41e0aff7f099fadb665449aaa97a38b766606cfd70dbd4fcd5b215b7839aa7f2e2ec4a7a112f8a2235e3c62fce32d672ed54a575257ae
7
- data.tar.gz: 0273a856d8370ed84550b133083d76076ee8a34252715de41b38722d58dca3f5ce155b7c851e9c089ebec69fae02d873ab0c8b0813649a83e7906febcb1cc497
6
+ metadata.gz: 8ab08f5e3bb2fc56427effe82fc71728e4fc0294ac20b74eaebc518a8acf90eed0efab83744a323ea8c5587952097f164b38ffc1d8c95cc6a0e9903f306608f9
7
+ data.tar.gz: 873c2117ffa487d4d82c956e02935180277dbf9157476e207a2f6f1f92f650f2c534ed956b3437e580e22b32ad4bb7b58fcdd39725cf6f66f2e0512bba2215d9
data/CHANGELOG.md CHANGED
@@ -1,408 +1,328 @@
1
- ## Rails 7.0.8 (September 09, 2023) ##
1
+ ## Rails 7.2.0 (August 09, 2024) ##
2
2
 
3
- * Omit `webdrivers` gem dependency from `Gemfile` template
4
-
5
- *Sean Doyle*
6
-
7
- ## Rails 7.0.7.2 (August 22, 2023) ##
8
-
9
- * No changes.
10
-
11
-
12
- ## Rails 7.0.7.1 (August 22, 2023) ##
13
-
14
- * No changes.
3
+ * The new `bin/rails boot` command boots the application and exits. Supports the
4
+ standard `-e/--environment` options.
15
5
 
6
+ *Xavier Noria*
16
7
 
17
- ## Rails 7.0.7 (August 09, 2023) ##
8
+ * Create a Dev Container Generator that generates a Dev Container setup based on the current configuration
9
+ of the application. Usage:
18
10
 
19
- * Update default scaffold templates to set 303 (See Other) as status code
20
- on redirect for the update action for XHR requests other than GET or POST
21
- to avoid issues (e.g browsers trying to follow the redirect using the
22
- original request method resulting in double PATCH/PUT)
11
+ `bin/rails devcontainer`
23
12
 
24
- *Guillermo Iguaran*
13
+ *Andrew Novoselac*
25
14
 
15
+ * Add Rubocop and GitHub Actions to plugin generator.
16
+ This can be skipped using --skip-rubocop and --skip-ci.
26
17
 
27
- ## Rails 7.0.6 (June 29, 2023) ##
28
- * Avoid escaping paths when editing credentials.
18
+ *Chris Oliver*
29
19
 
30
- *Jonathan Hefner*
20
+ * Remove support for `oracle`, `sqlserver` and JRuby specific database adapters from the
21
+ `rails new` and `rails db:system:change` commands.
31
22
 
23
+ The supported options are `sqlite3`, `mysql`, `postgresql` and `trilogy`.
32
24
 
33
- ## Rails 7.0.5.1 (June 26, 2023) ##
25
+ *Andrew Novoselac*
34
26
 
35
- * No changes.
27
+ * Add options to `bin/rails app:update`.
36
28
 
29
+ `bin/rails app:update` now supports the same generic options that generators do:
37
30
 
38
- ## Rails 7.0.5 (May 24, 2023) ##
31
+ * `--force`: Accept all changes to existing files
32
+ * `--skip`: Refuse all changes to existing files
33
+ * `--pretend`: Don't make any changes
34
+ * `--quiet`: Don't output all changes made
39
35
 
40
- * Add puma app server to Gemfile in order to start test/dummy.
36
+ *Étienne Barrié*
41
37
 
42
- *Donapieppo*
38
+ * Implement Rails console commands and helpers with IRB v1.13's extension APIs.
43
39
 
44
- * Rails console now disables `IRB`'s autocompletion feature in production by default.
40
+ Rails console users will now see `helper`, `controller`, `new_session`, and `app` under
41
+ IRB help message's `Helper methods` category. And `reload!` command will be displayed under
42
+ the new `Rails console` commands category.
45
43
 
46
- Setting `IRB_USE_AUTOCOMPLETE=true` can override this default.
44
+ Prior to this change, Rails console's commands and helper methods are added through IRB's
45
+ private components and don't show up in its help message, which led to poor discoverability.
47
46
 
48
47
  *Stan Lo*
49
48
 
50
- * Send 303 See Other status code back for the destroy action on newly generated
51
- scaffold controllers.
52
-
53
- *Tony Drake*
49
+ * Remove deprecated `Rails::Generators::Testing::Behaviour`.
54
50
 
51
+ *Rafael Mendonça França*
55
52
 
56
- ## Rails 7.0.4.3 (March 13, 2023) ##
53
+ * Remove deprecated `find_cmd_and_exec` console helper.
57
54
 
58
- * No changes.
55
+ *Rafael Mendonça França*
59
56
 
57
+ * Remove deprecated `Rails.config.enable_dependency_loading`.
60
58
 
61
- ## Rails 7.0.4.2 (January 24, 2023) ##
59
+ *Rafael Mendonça França*
62
60
 
63
- * No changes.
61
+ * Remove deprecated `Rails.application.secrets`.
64
62
 
63
+ *Rafael Mendonça França*
65
64
 
66
- ## Rails 7.0.4.1 (January 17, 2023) ##
65
+ * Generated Gemfile will include `require: "debug/prelude"` for the `debug` gem.
67
66
 
68
- * No changes.
67
+ Requiring `debug` gem directly automatically activates it, which could introduce
68
+ additional overhead and memory usage even without entering a debugging session.
69
69
 
70
+ By making Bundler require `debug/prelude` instead, developers can keep their access
71
+ to breakpoint methods like `debugger` or `binding.break`, but the debugger won't be
72
+ activated until a breakpoint is hit.
70
73
 
71
- ## Rails 7.0.4 (September 09, 2022) ##
74
+ *Stan Lo*
72
75
 
73
- * `config.allow_concurrency = false` now use a `Monitor` instead of a `Mutex`
76
+ * Skip generating a `test` job in ci.yml when a new application is generated with the
77
+ `--skip-test` option.
74
78
 
75
- This allows to enable `config.active_support.executor_around_test_case` even
76
- when `config.allow_concurrency` is disabled.
79
+ *Steve Polito*
77
80
 
78
- *Jean Boussier*
81
+ * Update the `.node-version` file conditionally generated for new applications to 20.11.1
79
82
 
80
- * Skip Active Storage and Action Mailer if Active Job is skipped.
83
+ *Steve Polito*
81
84
 
82
- *Étienne Barrié*
85
+ * Fix sanitizer vendor configuration in 7.1 defaults.
83
86
 
84
- * Correctly check if frameworks are disabled when running app:update.
87
+ In apps where rails-html-sanitizer was not eagerly loaded, the sanitizer default could end up
88
+ being Rails::HTML4::Sanitizer when it should be set to Rails::HTML5::Sanitizer.
85
89
 
86
- *Étienne Barrié* and *Paulo Barros*
90
+ *Mike Dalessio*, *Rafael Mendonça França*
87
91
 
88
- * Fixed `config.active_support.cache_format_version` never being applied.
92
+ * Set `action_mailer.default_url_options` values in `development` and `test`.
89
93
 
90
- Rails 7.0 shipped with a new serializer for Rails.cache, but the associated config
91
- wasn't working properly. Note that even after this fix, it can only be applied from
92
- the `application.rb` file.
94
+ Prior to this commit, new Rails applications would raise `ActionView::Template::Error`
95
+ if a mailer included a url built with a `*_path` helper.
93
96
 
94
- *Alex Ghiculescu*
97
+ *Steve Polito*
95
98
 
99
+ * Introduce `Rails::Generators::Testing::Assertions#assert_initializer`.
96
100
 
97
- ## Rails 7.0.3.1 (July 12, 2022) ##
101
+ Compliments the existing `initializer` generator action.
98
102
 
99
- * No changes.
103
+ ```rb
104
+ assert_initializer "mail_interceptors.rb"
105
+ ```
100
106
 
107
+ *Steve Polito*
101
108
 
102
- ## Rails 7.0.3 (May 09, 2022) ##
109
+ * Generate a .devcontainer folder and its contents when creating a new app.
103
110
 
104
- * If reloading and eager loading are both enabled, after a reload Rails eager loads again the application code.
111
+ The .devcontainer folder includes everything needed to boot the app and do development in a remote container.
105
112
 
106
- *Xavier Noria*
113
+ The container setup includes:
114
+ - A redis container for Kredis, ActionCable etc.
115
+ - A database (SQLite, Postgres, MySQL or MariaDB)
116
+ - A Headless chrome container for system tests
117
+ - Active Storage configured to use the local disk and with preview features working
107
118
 
108
- * Use `controller_class_path` in `Rails::Generators::NamedBase#route_url`
119
+ If any of these options are skipped in the app setup they will not be included in the container configuration.
109
120
 
110
- The `route_url` method now returns the correct path when generating
111
- a namespaced controller with a top-level model using `--model-name`.
121
+ These files can be skipped using the `--skip-devcontainer` option.
112
122
 
113
- Previously, when running this command:
123
+ *Andrew Novoselac & Rafael Mendonça França*
114
124
 
115
- ``` sh
116
- bin/rails generate scaffold_controller Admin/Post --model-name Post
117
- ```
125
+ * Introduce `SystemTestCase#served_by` for configuring the System Test application server.
118
126
 
119
- the comments above the controller action would look like:
127
+ By default this is localhost. This method allows the host and port to be specified manually.
120
128
 
121
- ``` ruby
122
- # GET /posts
123
- def index
124
- @posts = Post.all
129
+ ```ruby
130
+ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
131
+ served_by host: "testserver", port: 45678
125
132
  end
126
133
  ```
127
134
 
128
- afterwards, they now look like this:
129
-
130
- ``` ruby
131
- # GET /admin/posts
132
- def index
133
- @posts = Post.all
134
- end
135
- ```
136
-
137
- Fixes #44662.
138
-
139
- *Andrew White*
140
-
141
- ## Rails 7.0.2.4 (April 26, 2022) ##
142
-
143
- * No changes.
144
-
145
-
146
- ## Rails 7.0.2.3 (March 08, 2022) ##
147
-
148
- * No changes.
149
-
150
-
151
- ## Rails 7.0.2.2 (February 11, 2022) ##
152
-
153
- * No changes.
154
-
155
-
156
- ## Rails 7.0.2.1 (February 11, 2022) ##
157
-
158
- * No changes.
159
-
160
-
161
- ## Rails 7.0.2 (February 08, 2022) ##
162
-
163
- * No changes.
164
-
165
-
166
- ## Rails 7.0.1 (January 06, 2022) ##
167
-
168
- * Prevent duplicate entries in plugin Gemfile.
169
-
170
- *Jonathan Hefner*
135
+ *Andrew Novoselac & Rafael Mendonça França*
171
136
 
172
- * Fix asset pipeline errors for plugin dummy apps.
137
+ * `bin/rails test` will no longer load files named `*_test.rb` if they are located in the `fixtures` folder.
173
138
 
174
- *Jonathan Hefner*
139
+ *Edouard Chin*
175
140
 
176
- * Fix generated route revocation.
141
+ * Ensure logger tags configured with `config.log_tags` are still active in `request.action_dispatch` handlers.
177
142
 
178
- *Jonathan Hefner*
143
+ *KJ Tsanaktsidis*
179
144
 
180
- * Addresses an issue in which Sidekiq jobs could not reload certain
181
- namespaces.
145
+ * Setup jemalloc in the default Dockerfile for memory optimization.
182
146
 
183
- See [fxn/zeitwerk#198](https://github.com/fxn/zeitwerk/issues/198) for
184
- details.
147
+ *Matt Almeida*, *Jean Boussier*
185
148
 
186
- *Xavier Noria*
187
-
188
- * Fix plugin generator to a plugin that pass all the tests.
189
-
190
- *Rafael Mendonça França*
191
-
192
-
193
- ## Rails 7.0.0 (December 15, 2021) ##
149
+ * Commented out lines in .railsrc file should not be treated as arguments when using
150
+ rails new generator command. Update ARGVScrubber to ignore text after `#` symbols.
194
151
 
195
- * No changes.
152
+ *Willian Tenfen*
196
153
 
154
+ * Skip CSS when generating APIs.
197
155
 
198
- ## Rails 7.0.0.rc3 (December 14, 2021) ##
156
+ *Ruy Rocha*
199
157
 
200
- * Allow localhost with a port by default in development
158
+ * Rails console now indicates application name and the current Rails environment:
201
159
 
202
- [Fixes: #43864]
203
-
204
- ## Rails 7.0.0.rc2 (December 14, 2021) ##
205
-
206
- * No changes
160
+ ```txt
161
+ my-app(dev)> # for RAILS_ENV=development
162
+ my-app(test)> # for RAILS_ENV=test
163
+ my-app(prod)> # for RAILS_ENV=production
164
+ my-app(my_env)> # for RAILS_ENV=my_env
165
+ ```
207
166
 
208
- ## Rails 7.0.0.rc1 (December 06, 2021) ##
167
+ The application name is derived from the application's module name from `config/application.rb`.
168
+ For example, `MyApp` will displayed as `my-app` in the prompt.
209
169
 
210
- * Remove deprecated `config` in `dbconsole`.
170
+ Additionally, the environment name will be colorized when the environment is
171
+ `development` (blue), `test` (blue), or `production` (red), if your
172
+ terminal supports it.
211
173
 
212
- *Rafael Mendonça França*
174
+ *Stan Lo*
213
175
 
214
- * Change default `X-XSS-Protection` header to disable XSS auditor
176
+ * Ensure `autoload_paths`, `autoload_once_paths`, `eager_load_paths`, and
177
+ `load_paths` only have directories when initialized from engine defaults.
215
178
 
216
- This header has been deprecated and the XSS auditor it triggered
217
- has been removed from all major modern browsers (in favour of
218
- Content Security Policy) that implemented this header to begin with
219
- (Firefox never did).
179
+ Previously, files under the `app` directory could end up there too.
220
180
 
221
- [OWASP](https://owasp.org/www-project-secure-headers/#x-xss-protection)
222
- suggests setting this header to '0' to disable the default behaviour
223
- on old browsers as it can introduce additional security issues.
181
+ *Takumasa Ochi*
224
182
 
225
- Added the new behaviour as a framework default from Rails 7.0.
183
+ * Prevent unnecessary application reloads in development.
226
184
 
227
- *Christian Sutter*
185
+ Previously, some files outside autoload paths triggered unnecessary reloads.
186
+ With this fix, application reloads according to `Rails.autoloaders.main.dirs`,
187
+ thereby preventing unnecessary reloads.
228
188
 
229
- * Scaffolds now use date_field, time_field and datetime_field instead of
230
- date_select, time_select and datetime_select; thus providing native date/time pickers.
189
+ *Takumasa Ochi*
231
190
 
232
- *Martijn Lafeber*
191
+ * Use `oven-sh/setup-bun` in GitHub CI when generating an app with Bun.
233
192
 
234
- * Fix a regression in which autoload paths were initialized too late.
193
+ *TangRufus*
235
194
 
236
- *Xavier Noria*
195
+ * Disable `pidfile` generation in the `production` environment.
237
196
 
238
- ## Rails 7.0.0.alpha2 (September 15, 2021) ##
197
+ *Hans Schnedlitz*
239
198
 
240
- * Fix activestorage dependency in the npm package.
199
+ * Set `config.action_view.annotate_rendered_view_with_filenames` to `true` in
200
+ the `development` environment.
241
201
 
242
- *Rafael Mendonça França*
202
+ *Adrian Marin*
243
203
 
244
- ## Rails 7.0.0.alpha1 (September 15, 2021) ##
204
+ * Support the `BACKTRACE` environment variable to turn off backtrace cleaning.
245
205
 
246
- * New and upgraded Rails apps no longer generate `config/initializers/application_controller_renderer.rb`
247
- or `config/initializers/cookies_serializer.rb`
206
+ Useful for debugging framework code:
248
207
 
249
- The default value for `cookies_serializer` (`:json`) has been moved to `config.load_defaults("7.0")`.
250
- The new framework defaults file can be used to upgrade the serializer.
208
+ ```sh
209
+ BACKTRACE=1 bin/rails server
210
+ ```
251
211
 
252
212
  *Alex Ghiculescu*
253
213
 
254
- * New applications get a dependency on the new `debug` gem, replacing `byebug`.
255
-
256
- *Xavier Noria*
257
-
258
- * Add SSL support for postgresql in `bin/rails dbconsole`.
259
-
260
- Fixes #43114.
261
-
262
- *Michael Bayucot*
263
-
264
- * Add support for comments above gem declaration in Rails application templates, e.g. `gem("nokogiri", comment: "For XML")`.
265
-
266
- *Linas Juškevičius*
267
-
268
- * The setter `config.autoloader=` has been deleted. `zeitwerk` is the only
269
- available autoloading mode.
214
+ * Raise `ArgumentError` when reading `config.x.something` with arguments:
270
215
 
271
- *Xavier Noria*
272
-
273
- * `config.autoload_once_paths` can be configured in the body of the
274
- application class defined in `config/application.rb` or in the configuration
275
- for environments in `config/environments/*`.
276
-
277
- Similarly, engines can configure that collection in the class body of the
278
- engine class or in the configuration for environments.
279
-
280
- After that, the collection is frozen, and you can autoload from those paths.
281
- They are managed by the `Rails.autoloaders.once` autoloader, which does not
282
- reload, only autoloads/eager loads.
283
-
284
- *Xavier Noria*
285
-
286
- * During initialization, you cannot autoload reloadable classes or modules
287
- like application models, unless they are wrapped in a `to_prepare` block.
288
- For example, from `config/initializers/*`, or in application, engines, or
289
- railties initializers.
290
-
291
- Please check the [autoloading
292
- guide](https://guides.rubyonrails.org/v7.0/autoloading_and_reloading_constants.html#autoloading-when-the-application-boots)
293
- for details.
294
-
295
- *Xavier Noria*
296
-
297
- * While they are allowed to have elements in common, it is no longer required
298
- that `config.autoload_once_paths` is a subset of `config.autoload_paths`.
299
- The former are managed by the `once` autoloader. The `main` autoloader
300
- manages the latter minus the former.
301
-
302
- *Xavier Noria*
216
+ ```ruby
217
+ config.x.this_works.this_raises true # raises ArgumentError
218
+ ```
303
219
 
304
- * Show Rake task description if command is run with `-h`.
220
+ *Sean Doyle*
305
221
 
306
- Adding `-h` (or `--help`) to a Rails command that's a Rake task now outputs
307
- the task description instead of the general Rake help.
222
+ * 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.
308
223
 
309
- *Petrik de Heus*
224
+ *DHH*
310
225
 
311
- * Add missing `plugin new` command to help.
226
+ * Updated system tests to now use headless Chrome by default for the new applications.
312
227
 
313
- *Petrik de Heus
228
+ *DHH*
314
229
 
315
- * Fix `config_for` error when there's only a shared root array.
230
+ * Add GitHub CI files for Dependabot, Brakeman, RuboCop, and running tests by default. Can be skipped with `--skip-ci`.
316
231
 
317
- *Loïc Delmaire*
232
+ *DHH*
318
233
 
319
- * Raise an error in generators if an index type is invalid.
234
+ * Add Brakeman by default for static analysis of security vulnerabilities. Allow skipping with `--skip-brakeman option`.
320
235
 
321
- *Petrik de Heus*
236
+ *vipulnsward*
322
237
 
323
- * `package.json` now uses a strict version constraint for Rails JavaScript packages on new Rails apps.
238
+ * Add RuboCop with rules from `rubocop-rails-omakase` by default. Skip with `--skip-rubocop`.
324
239
 
325
- *Zachary Scott*, *Alex Ghiculescu*
240
+ *DHH* and *zzak*
326
241
 
327
- * Modified scaffold generator template so that running
328
- `rails g scaffold Author` no longer generates tests called "creating
329
- a Author", "updating a Author", and "destroying a Author".
242
+ * Use `bin/rails runner --skip-executor` to not wrap the runner script with an
243
+ Executor.
330
244
 
331
- Fixes #40744.
245
+ *Ben Sheldon*
332
246
 
333
- *Michael Duchemin*
247
+ * Fix isolated engines to take `ActiveRecord::Base.table_name_prefix` into consideration.
334
248
 
335
- * Raise an error in generators if a field type is invalid.
249
+ This will allow for engine defined models, such as inside Active Storage, to respect
250
+ Active Record table name prefix configuration.
336
251
 
337
- *Petrik de Heus*
252
+ *Chedli Bourguiba*
338
253
 
339
- * `bin/rails tmp:clear` deletes also files and directories in `tmp/storage`.
254
+ * Fix running `db:system:change` when the app has no Dockerfile.
340
255
 
341
- *George Claghorn*
256
+ *Hartley McGuire*
342
257
 
343
- * Fix compatibility with `psych >= 4`.
258
+ * In Action Mailer previews, list inline attachments separately from normal
259
+ attachments.
344
260
 
345
- Starting in Psych 4.0.0 `YAML.load` behaves like `YAML.safe_load`. To preserve compatibility
346
- `Rails.application.config_for` now uses `YAML.unsafe_load` if available.
261
+ For example, attachments that were previously listed like
347
262
 
348
- *Jean Boussier*
263
+ > Attachments: logo.png file1.pdf file2.pdf
349
264
 
350
- * Allow loading nested locales in engines.
265
+ will now be listed like
351
266
 
352
- *Gannon McGibbon*
267
+ > Attachments: file1.pdf file2.pdf (Inline: logo.png)
353
268
 
354
- * Ensure `Rails.application.config_for` always cast hashes to `ActiveSupport::OrderedOptions`.
269
+ *Christian Schmidt* and *Jonathan Hefner*
355
270
 
356
- *Jean Boussier*
271
+ * In mailer preview, only show SMTP-To if it differs from the union of To, Cc and Bcc.
357
272
 
358
- * Remove `Rack::Runtime` from the default middleware stack and deprecate
359
- referencing it in middleware operations without adding it back.
273
+ *Christian Schmidt*
360
274
 
361
- *Hartley McGuire*
275
+ * Enable YJIT by default on new applications running Ruby 3.3+.
362
276
 
363
- * Allow adding additional authorized hosts in development via `ENV['RAILS_DEVELOPMENT_HOSTS']`.
277
+ This can be disabled by setting `Rails.application.config.yjit = false`
364
278
 
365
- *Josh Abernathy*, *Debbie Milburn*
279
+ *Jean Boussier*, *Rafael Mendonça França*
366
280
 
367
- * Add app concern and test keepfiles to generated engine plugins.
281
+ * In Action Mailer previews, show date from message `Date` header if present.
368
282
 
369
- *Gannon McGibbon*
283
+ *Sampat Badhe*
370
284
 
371
- * Stop generating a license for in-app plugins.
285
+ * Exit with non-zero status when the migration generator fails.
372
286
 
373
- *Gannon McGibbon*
287
+ *Katsuhiko YOSHIDA*
374
288
 
375
- * `rails app:update` no longer prompts you to overwrite files that are generally modified in the
376
- course of developing a Rails app. See [#41083](https://github.com/rails/rails/pull/41083) for
377
- the full list of changes.
289
+ * Use numeric UID and GID in Dockerfile template.
378
290
 
379
- *Alex Ghiculescu*
291
+ The Dockerfile generated by `rails new` sets the default user and group
292
+ by name instead of UID:GID. This can cause the following error in Kubernetes:
380
293
 
381
- * Change default branch for new Rails projects and plugins to `main`.
294
+ ```
295
+ container has runAsNonRoot and image has non-numeric user (rails), cannot verify user is non-root
296
+ ```
382
297
 
383
- *Prateek Choudhary*
298
+ This change sets default user and group by their numeric values.
384
299
 
385
- * The new method `Rails.benchmark` gives you a quick way to measure and log the execution time taken by a block:
300
+ *Ivan Fedotov*
386
301
 
387
- def test_expensive_stuff
388
- Rails.benchmark("test_expensive_stuff") { ... }
389
- end
302
+ * Disallow invalid values for rails new options.
390
303
 
391
- This functionality was available in some contexts only before.
304
+ The `--database`, `--asset-pipeline`, `--css`, and `--javascript` options
305
+ for `rails new` take different arguments. This change validates them.
392
306
 
393
- *Simon Perepelitsa*
307
+ *Tony Drake*, *Akhil G Krishnan*, *Petrik de Heus*
394
308
 
395
- * Applications generated with `--skip-sprockets` no longer get `app/assets/config/manifest.js` and `app/assets/stylesheets/application.css`.
309
+ * Conditionally print `$stdout` when invoking `run_generator`.
396
310
 
397
- *Cindy Gao*
311
+ In an effort to improve the developer experience when debugging
312
+ generator tests, we add the ability to conditionally print `$stdout`
313
+ instead of capturing it.
398
314
 
399
- * Add support for stylesheets and ERB views to `rails stats`.
315
+ This allows for calls to `binding.irb` and `puts` work as expected.
400
316
 
401
- *Joel Hawksley*
317
+ ```sh
318
+ RAILS_LOG_TO_STDOUT=true ./bin/test test/generators/actions_test.rb
319
+ ```
402
320
 
403
- * Allow appended root routes to take precedence over internal welcome controller.
321
+ *Steve Polito*
404
322
 
405
- *Gannon McGibbon*
323
+ * Remove the option `config.public_file_server.enabled` from the generators
324
+ for all environments, as the value is the same in all environments.
406
325
 
326
+ *Adrian Hirt*
407
327
 
408
- Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/railties/CHANGELOG.md) for previous changes.
328
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/railties/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2022 David Heinemeier Hansson
1
+ Copyright (c) David Heinemeier Hansson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the