railties 5.2.7.1 → 6.1.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +276 -158
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.rdoc +39 -33
  5. data/README.rdoc +3 -3
  6. data/lib/minitest/rails_plugin.rb +23 -12
  7. data/lib/rails/all.rb +4 -0
  8. data/lib/rails/api/generator.rb +2 -1
  9. data/lib/rails/api/task.rb +18 -1
  10. data/lib/rails/app_loader.rb +2 -2
  11. data/lib/rails/app_updater.rb +3 -1
  12. data/lib/rails/application/bootstrap.rb +9 -17
  13. data/lib/rails/application/configuration.rb +184 -26
  14. data/lib/rails/application/default_middleware_stack.rb +7 -3
  15. data/lib/rails/application/dummy_erb_compiler.rb +18 -0
  16. data/lib/rails/application/finisher.rb +68 -1
  17. data/lib/rails/application/routes_reloader.rb +9 -3
  18. data/lib/rails/application.rb +86 -65
  19. data/lib/rails/application_controller.rb +0 -1
  20. data/lib/rails/autoloaders.rb +48 -0
  21. data/lib/rails/backtrace_cleaner.rb +14 -21
  22. data/lib/rails/code_statistics.rb +8 -6
  23. data/lib/rails/code_statistics_calculator.rb +6 -6
  24. data/lib/rails/command/base.rb +13 -5
  25. data/lib/rails/command/behavior.rb +8 -49
  26. data/lib/rails/command/environment_argument.rb +9 -16
  27. data/lib/rails/command/spellchecker.rb +57 -0
  28. data/lib/rails/command.rb +16 -11
  29. data/lib/rails/commands/console/console_command.rb +6 -0
  30. data/lib/rails/commands/credentials/USAGE +33 -0
  31. data/lib/rails/commands/credentials/credentials_command/diffing.rb +41 -0
  32. data/lib/rails/commands/credentials/credentials_command.rb +76 -19
  33. data/lib/rails/commands/db/system/change/change_command.rb +25 -0
  34. data/lib/rails/commands/dbconsole/dbconsole_command.rb +66 -51
  35. data/lib/rails/commands/dev/dev_command.rb +19 -0
  36. data/lib/rails/commands/encrypted/USAGE +1 -1
  37. data/lib/rails/commands/encrypted/encrypted_command.rb +4 -4
  38. data/lib/rails/commands/generate/generate_command.rb +1 -1
  39. data/lib/rails/commands/help/help_command.rb +1 -1
  40. data/lib/rails/commands/initializers/initializers_command.rb +23 -0
  41. data/lib/rails/commands/new/new_command.rb +2 -2
  42. data/lib/rails/commands/notes/notes_command.rb +29 -0
  43. data/lib/rails/commands/plugin/plugin_command.rb +1 -1
  44. data/lib/rails/commands/rake/rake_command.rb +9 -8
  45. data/lib/rails/commands/routes/routes_command.rb +37 -0
  46. data/lib/rails/commands/runner/runner_command.rb +13 -9
  47. data/lib/rails/commands/secrets/USAGE +6 -0
  48. data/lib/rails/commands/secrets/secrets_command.rb +3 -3
  49. data/lib/rails/commands/server/server_command.rb +92 -56
  50. data/lib/rails/commands/test/test_command.rb +2 -2
  51. data/lib/rails/configuration.rb +48 -19
  52. data/lib/rails/engine/configuration.rb +6 -2
  53. data/lib/rails/engine/updater.rb +1 -1
  54. data/lib/rails/engine.rb +59 -49
  55. data/lib/rails/gem_version.rb +4 -4
  56. data/lib/rails/generators/actions/create_migration.rb +7 -1
  57. data/lib/rails/generators/actions.rb +89 -56
  58. data/lib/rails/generators/app_base.rb +90 -106
  59. data/lib/rails/generators/app_name.rb +50 -0
  60. data/lib/rails/generators/base.rb +15 -12
  61. data/lib/rails/generators/database.rb +57 -0
  62. data/lib/rails/generators/erb/mailer/mailer_generator.rb +1 -2
  63. data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +0 -1
  64. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +7 -4
  65. data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +1 -1
  66. data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +9 -1
  67. data/lib/rails/generators/erb.rb +0 -1
  68. data/lib/rails/generators/generated_attribute.rb +50 -31
  69. data/lib/rails/generators/migration.rb +3 -3
  70. data/lib/rails/generators/model_helpers.rb +33 -2
  71. data/lib/rails/generators/named_base.rb +3 -7
  72. data/lib/rails/generators/rails/app/USAGE +2 -1
  73. data/lib/rails/generators/rails/app/app_generator.rb +120 -84
  74. data/lib/rails/generators/rails/app/templates/Gemfile.tt +17 -20
  75. data/lib/rails/generators/rails/app/templates/Rakefile.tt +1 -1
  76. data/lib/rails/generators/rails/app/templates/app/assets/config/manifest.js.tt +0 -3
  77. data/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js +6 -0
  78. data/lib/rails/generators/rails/app/templates/app/javascript/channels/index.js +5 -0
  79. data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +23 -0
  80. data/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt +5 -0
  81. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +6 -5
  82. data/lib/rails/generators/rails/app/templates/bin/rails.tt +5 -2
  83. data/lib/rails/generators/rails/app/templates/bin/rake.tt +5 -2
  84. data/lib/rails/generators/rails/app/templates/bin/setup.tt +9 -9
  85. data/lib/rails/generators/rails/app/templates/bin/spring.tt +13 -0
  86. data/lib/rails/generators/rails/app/templates/bin/yarn.tt +9 -3
  87. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +16 -7
  88. data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +2 -2
  89. data/lib/rails/generators/rails/app/templates/config/cable.yml.tt +1 -1
  90. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +4 -5
  91. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +12 -11
  92. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +13 -12
  93. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +1 -1
  94. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +13 -12
  95. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +12 -11
  96. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +16 -15
  97. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +1 -1
  98. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +11 -10
  99. data/lib/rails/generators/rails/app/templates/config/environment.rb.tt +1 -1
  100. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +22 -5
  101. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +43 -17
  102. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +26 -7
  103. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +1 -1
  104. data/lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb.tt +4 -3
  105. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +7 -0
  106. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +3 -1
  107. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +67 -0
  108. data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +11 -0
  109. data/lib/rails/generators/rails/app/templates/config/locales/en.yml +1 -1
  110. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +10 -4
  111. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +1 -1
  112. data/lib/rails/generators/rails/app/templates/config/spring.rb.tt +6 -6
  113. data/lib/rails/generators/rails/app/templates/config.ru.tt +2 -1
  114. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +1 -1
  115. data/lib/rails/generators/rails/app/templates/gitattributes.tt +14 -0
  116. data/lib/rails/generators/rails/app/templates/gitignore.tt +8 -8
  117. data/lib/rails/generators/rails/app/templates/package.json.tt +8 -2
  118. data/lib/rails/generators/rails/app/templates/public/robots.txt +1 -1
  119. data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -1
  120. data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +11 -0
  121. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +9 -2
  122. data/lib/rails/generators/rails/assets/USAGE +3 -7
  123. data/lib/rails/generators/rails/assets/assets_generator.rb +0 -1
  124. data/lib/rails/generators/rails/benchmark/USAGE +19 -0
  125. data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +29 -0
  126. data/lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt +15 -0
  127. data/lib/rails/generators/rails/controller/USAGE +2 -2
  128. data/lib/rails/generators/rails/controller/controller_generator.rb +10 -39
  129. data/lib/rails/generators/rails/credentials/credentials_generator.rb +6 -7
  130. data/lib/rails/generators/rails/db/system/change/change_generator.rb +65 -0
  131. data/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb +10 -7
  132. data/lib/rails/generators/rails/generator/USAGE +2 -2
  133. data/lib/rails/generators/rails/generator/generator_generator.rb +0 -1
  134. data/lib/rails/generators/rails/generator/templates/USAGE.tt +1 -1
  135. data/lib/rails/generators/rails/helper/USAGE +2 -3
  136. data/lib/rails/generators/rails/helper/helper_generator.rb +5 -0
  137. data/lib/rails/generators/rails/integration_test/USAGE +2 -2
  138. data/lib/rails/generators/rails/migration/USAGE +4 -4
  139. data/lib/rails/generators/rails/model/USAGE +15 -16
  140. data/lib/rails/generators/rails/plugin/plugin_generator.rb +33 -56
  141. data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +10 -19
  142. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +3 -10
  143. data/lib/rails/generators/rails/plugin/templates/Rakefile.tt +4 -18
  144. data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +1 -2
  145. data/lib/rails/generators/rails/plugin/templates/app/helpers/%namespaced_name%/application_helper.rb.tt +1 -1
  146. data/lib/rails/generators/rails/plugin/templates/app/jobs/%namespaced_name%/application_job.rb.tt +1 -1
  147. data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +1 -1
  148. data/lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt +1 -1
  149. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +3 -3
  150. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +14 -11
  151. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +1 -1
  152. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/railtie.rb.tt +1 -1
  153. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%.rb.tt +1 -0
  154. data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +1 -1
  155. data/lib/rails/generators/rails/plugin/templates/test/%namespaced_name%_test.rb.tt +4 -4
  156. data/lib/rails/generators/rails/plugin/templates/test/integration/navigation_test.rb.tt +1 -1
  157. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +0 -4
  158. data/lib/rails/generators/rails/resource/USAGE +4 -4
  159. data/lib/rails/generators/rails/resource_route/resource_route_generator.rb +2 -27
  160. data/lib/rails/generators/rails/scaffold/USAGE +5 -5
  161. data/lib/rails/generators/rails/scaffold_controller/USAGE +2 -2
  162. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +19 -0
  163. data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +2 -2
  164. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +2 -2
  165. data/lib/rails/generators/rails/system_test/USAGE +2 -2
  166. data/lib/rails/generators/rails/task/USAGE +3 -3
  167. data/lib/rails/generators/resource_helpers.rb +1 -6
  168. data/lib/rails/generators/test_case.rb +1 -1
  169. data/lib/rails/generators/test_unit/controller/controller_generator.rb +2 -0
  170. data/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt +3 -3
  171. data/lib/rails/generators/test_unit/generator/generator_generator.rb +0 -1
  172. data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +2 -2
  173. data/lib/rails/generators/test_unit/integration/integration_generator.rb +5 -0
  174. data/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt +1 -1
  175. data/lib/rails/generators/test_unit/job/job_generator.rb +5 -0
  176. data/lib/rails/generators/test_unit/job/templates/unit_test.rb.tt +1 -1
  177. data/lib/rails/generators/test_unit/mailer/mailer_generator.rb +1 -1
  178. data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +1 -1
  179. data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +3 -3
  180. data/lib/rails/generators/test_unit/model/templates/unit_test.rb.tt +1 -1
  181. data/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +1 -1
  182. data/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +2 -2
  183. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +8 -4
  184. data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +1 -1
  185. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +1 -1
  186. data/lib/rails/generators/test_unit/system/system_generator.rb +5 -0
  187. data/lib/rails/generators/testing/assertions.rb +2 -2
  188. data/lib/rails/generators/testing/behaviour.rb +4 -2
  189. data/lib/rails/generators.rb +38 -24
  190. data/lib/rails/info.rb +4 -4
  191. data/lib/rails/info_controller.rb +2 -3
  192. data/lib/rails/mailers_controller.rb +8 -4
  193. data/lib/rails/paths.rb +26 -10
  194. data/lib/rails/rack/logger.rb +1 -2
  195. data/lib/rails/railtie/configurable.rb +0 -1
  196. data/lib/rails/railtie/configuration.rb +3 -3
  197. data/lib/rails/railtie.rb +33 -13
  198. data/lib/rails/ruby_version_check.rb +3 -3
  199. data/lib/rails/secrets.rb +0 -1
  200. data/lib/rails/source_annotation_extractor.rb +124 -117
  201. data/lib/rails/tasks/engine.rake +1 -4
  202. data/lib/rails/tasks/framework.rake +12 -2
  203. data/lib/rails/tasks/log.rake +0 -1
  204. data/lib/rails/tasks/misc.rake +1 -1
  205. data/lib/rails/tasks/statistics.rake +5 -1
  206. data/lib/rails/tasks/yarn.rake +14 -2
  207. data/lib/rails/tasks/zeitwerk.rake +69 -0
  208. data/lib/rails/tasks.rb +1 -4
  209. data/lib/rails/templates/rails/mailers/email.html.erb +1 -0
  210. data/lib/rails/templates/rails/welcome/index.html.erb +3 -3
  211. data/lib/rails/test_help.rb +11 -9
  212. data/lib/rails/test_unit/reporter.rb +3 -2
  213. data/lib/rails/test_unit/runner.rb +25 -8
  214. data/lib/rails/test_unit/testing.rake +7 -1
  215. data/lib/rails.rb +10 -8
  216. metadata +46 -40
  217. data/lib/rails/generators/js/assets/assets_generator.rb +0 -15
  218. data/lib/rails/generators/js/assets/templates/javascript.js +0 -2
  219. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +0 -22
  220. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.js.tt +0 -13
  221. data/lib/rails/generators/rails/app/templates/bin/bundle.tt +0 -2
  222. data/lib/rails/generators/rails/app/templates/bin/update.tt +0 -34
  223. data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt +0 -50
  224. data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt +0 -86
  225. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_2.rb.tt +0 -38
  226. data/lib/rails/generators/rails/assets/templates/javascript.js +0 -2
  227. data/lib/rails/generators/rails/plugin/templates/rails/application.rb.tt +0 -23
  228. data/lib/rails/tasks/annotations.rake +0 -22
  229. data/lib/rails/tasks/dev.rake +0 -10
  230. data/lib/rails/tasks/initializers.rake +0 -8
  231. data/lib/rails/tasks/routes.rake +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82cd47cccba6058b891b24cc0af9ea67565bba88450ccf8185c068d4618a7b2f
4
- data.tar.gz: 83d6014b1704186165fb8cc4f6a260f5d8ae503ff3e6103b1039d4743da13d1c
3
+ metadata.gz: 26052d7b5185bb60418f8bfb6625fe615e1b3fb58da488998c86a67faed889a9
4
+ data.tar.gz: cb033fc06f915f5972314d39d501e6f829c75c9f5a085af1126e8877919aecfe
5
5
  SHA512:
6
- metadata.gz: 67d2e9b003fe2046aeb404772ae20c6cf36d3809d6076bb17a4a2601645ab8d99f1a4aa0f06d01ed2d7e8c35361b2defd50879a45cda875124974302b69f1dd6
7
- data.tar.gz: e01c33762d950e221bace59d3d42dd8ea04ac6314d26d45395c6b703afb16c43526ef245ac09ea229538aa2614e1785823eb946bef11678906b5aa3a02c6a499
6
+ metadata.gz: ee0880f2aaa6a68b9a82d9fdd3c45d611d7ea60a5ce5244a538211249417276b189156912855f194c070bfa5035350f231ee3b2ffc70f95f3717975fae506ba7
7
+ data.tar.gz: 3227ffabd6600cc94a4b554cc09a6b480b80a994187352e4ca330220acee076a2e575c18991c96b510322fa2d37986d430c7de5e6b3a7ea0ed5016b0cbcfe5f1
data/CHANGELOG.md CHANGED
@@ -1,340 +1,458 @@
1
- ## Rails 5.2.7.1 (April 26, 2022) ##
1
+ ## Rails 6.1.4.6 (February 11, 2022) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 5.2.7 (March 10, 2022) ##
6
+ ## Rails 6.1.4.5 (February 11, 2022) ##
7
7
 
8
8
  * No changes.
9
9
 
10
10
 
11
- ## Rails 5.2.6.3 (March 08, 2022) ##
11
+ ## Rails 6.1.4.4 (December 15, 2021) ##
12
12
 
13
13
  * No changes.
14
14
 
15
15
 
16
- ## Rails 5.2.6.2 (February 11, 2022) ##
16
+ ## Rails 6.1.4.3 (December 14, 2021) ##
17
17
 
18
- * No changes.
18
+ * Allow localhost with a port by default in development
19
19
 
20
+ [Fixes: #43864]
20
21
 
21
- ## Rails 5.2.6.1 (February 11, 2022) ##
22
+ ## Rails 6.1.4.2 (December 14, 2021) ##
22
23
 
23
24
  * No changes.
24
25
 
25
26
 
26
- ## Rails 5.2.6 (May 05, 2021) ##
27
+ ## Rails 6.1.4.1 (August 19, 2021) ##
27
28
 
28
29
  * No changes.
29
30
 
30
31
 
31
- ## Rails 5.2.5 (March 26, 2021) ##
32
+ ## Rails 6.1.4 (June 24, 2021) ##
32
33
 
33
- * No changes.
34
+ * Fix compatibility with `psych >= 4`.
34
35
 
36
+ Starting in Psych 4.0.0 `YAML.load` behaves like `YAML.safe_load`. To preserve compatibility
37
+ `Rails.application.config_for` now uses `YAML.unsafe_load` if available.
35
38
 
36
- ## Rails 5.2.4.6 (May 05, 2021) ##
39
+ *Jean Boussier*
37
40
 
38
- * No changes.
41
+ * Ensure `Rails.application.config_for` always cast hashes to `ActiveSupport::OrderedOptions`.
42
+
43
+ *Jean Boussier*
39
44
 
45
+ * Fix create migration generator with `--pretend` option.
40
46
 
41
- ## Rails 5.2.4.5 (February 10, 2021) ##
47
+ *euxx*
48
+
49
+
50
+ ## Rails 6.1.3.2 (May 05, 2021) ##
42
51
 
43
52
  * No changes.
44
53
 
45
54
 
46
- ## Rails 5.2.4.4 (September 09, 2020) ##
55
+ ## Rails 6.1.3.1 (March 26, 2021) ##
47
56
 
48
57
  * No changes.
49
58
 
50
59
 
51
- ## Rails 5.2.4.3 (May 18, 2020) ##
60
+ ## Rails 6.1.3 (February 17, 2021) ##
52
61
 
53
62
  * No changes.
54
63
 
55
64
 
56
- ## Rails 5.2.4.2 (March 19, 2020) ##
65
+ ## Rails 6.1.2.1 (February 10, 2021) ##
57
66
 
58
67
  * No changes.
59
68
 
60
69
 
61
- ## Rails 5.2.4.1 (December 18, 2019) ##
70
+ ## Rails 6.1.2 (February 09, 2021) ##
62
71
 
63
72
  * No changes.
64
73
 
65
74
 
66
- ## Rails 5.2.4 (November 27, 2019) ##
75
+ ## Rails 6.1.1 (January 07, 2021) ##
67
76
 
68
- * Use original `bundler` environment variables during the process of generating a new rails project.
77
+ * Allow spaces in path to Yarn binstub and only run on precompile if needed.
69
78
 
70
- *Marco Costa*
79
+ *Markus Doits*
71
80
 
72
- * Allow loading seeds without ActiveJob.
81
+ * Populate ARGV for app template.
73
82
 
74
- Fixes #35782
83
+ Fixes #40945.
75
84
 
76
- *Jeremy Weathers*
85
+ *Jonathan Hefner*
77
86
 
78
- * Only force `:async` ActiveJob adapter to `:inline` during seeding.
79
87
 
80
- *BatedUrGonnaDie*
88
+ ## Rails 6.1.0 (December 09, 2020) ##
81
89
 
90
+ * Added `Railtie#server` hook called when Rails starts a server.
91
+ This is useful in case your application or a library needs to run
92
+ another process next to the Rails server. This is quite common in development
93
+ for instance to run the Webpack or the React server.
82
94
 
83
- ## Rails 5.2.3 (March 27, 2019) ##
95
+ It can be used like this:
84
96
 
85
- * Seed database with inline ActiveJob job adapter.
97
+ ```ruby
98
+ class MyRailtie < Rails::Railtie
99
+ server do
100
+ WebpackServer.run
101
+ end
102
+ end
103
+ ```
86
104
 
87
- *Gannon McGibbon*
105
+ *Edouard Chin*
88
106
 
89
- * Fix boolean interaction in scaffold system tests.
107
+ * Remove deprecated `rake dev:cache` tasks.
90
108
 
91
- *Gannon McGibbon*
109
+ *Rafael Mendonça França*
92
110
 
111
+ * Remove deprecated `rake routes` tasks.
93
112
 
94
- ## Rails 5.2.2.1 (March 11, 2019) ##
113
+ *Rafael Mendonça França*
95
114
 
96
- * Generate random development secrets
115
+ * Remove deprecated `rake initializers` tasks.
97
116
 
98
- A random development secret is now generated to tmp/development_secret.txt
117
+ *Rafael Mendonça França*
99
118
 
100
- This avoids an issue where development mode servers were vulnerable to
101
- remote code execution.
119
+ * Remove deprecated support for using the `HOST` environment variable to specify the server IP.
102
120
 
103
- Fixes CVE-2019-5420
121
+ *Rafael Mendonça França*
104
122
 
105
- *Eileen M. Uchitelle*, *Aaron Patterson*, *John Hawthorn*
123
+ * Remove deprecated `server` argument from the rails server command.
106
124
 
125
+ *Rafael Mendonça França*
107
126
 
108
- ## Rails 5.2.2 (December 04, 2018) ##
127
+ * Remove deprecated `SOURCE_ANNOTATION_DIRECTORIES` environment variable support from `rails notes`.
109
128
 
110
- * Disable content security policy for mailer previews.
129
+ *Rafael Mendonça França*
111
130
 
112
- *Dylan Reile*
131
+ * Remove deprecated `connection` option in the `rails dbconsole` command.
113
132
 
114
- * Log the remote IP address of clients behind a proxy.
133
+ *Rafael Mendonça França*
115
134
 
116
- *Atul Bhosale*
135
+ * Remove depreated `rake notes` tasks.
117
136
 
137
+ *Rafael Mendonça França*
118
138
 
119
- ## Rails 5.2.1.1 (November 27, 2018) ##
139
+ * Return a 405 Method Not Allowed response when a request uses an unknown HTTP method.
120
140
 
121
- * No changes.
141
+ Fixes #38998.
122
142
 
143
+ *Loren Norman*
123
144
 
124
- ## Rails 5.2.1 (August 07, 2018) ##
145
+ * Make railsrc file location xdg-specification compliant
125
146
 
126
- * Respect `NODE_ENV` when running `rails yarn:install`.
147
+ `rails new` will now look for the default `railsrc` file at
148
+ `$XDG_CONFIG_HOME/rails/railsrc` (or `~/.config/rails/railsrc` if
149
+ `XDG_CONFIG_HOME` is not set). If this file does not exist, `rails new`
150
+ will fall back to `~/.railsrc`.
127
151
 
128
- *Max Melentiev*
152
+ The fallback behaviour means this does not cause any breaking changes.
129
153
 
130
- * Don't generate unused files in `app:update` task
154
+ *Nick Wolf*
131
155
 
132
- Skip the assets' initializer when sprockets isn't loaded.
156
+ * Change the default logging level from :debug to :info to avoid inadvertent exposure of personally
157
+ identifiable information (PII) in production environments.
133
158
 
134
- Skip `config/spring.rb` when spring isn't loaded.
159
+ *Eric M. Payne*
135
160
 
136
- *Tsukuru Tanimichi*
161
+ * Automatically generate abstract class when using multiple databases.
137
162
 
138
- * Don't include `bootsnap` by default in apps generated under JRuby.
163
+ When generating a scaffold for a multiple database application, Rails will now automatically generate the abstract class for the database when the database argument is passed. This abstract class will include the connection information for the writing configuration and any models generated for that database will automatically inherit from the abstract class.
139
164
 
140
- Fixes #32641.
165
+ Usage:
141
166
 
142
- *Guillermo Iguaran*
167
+ ```bash
168
+ $ bin/rails generate scaffold Pet name:string --database=animals
169
+ ```
143
170
 
144
- * Create the `.ruby-version` file compatible with MRI/JRuby by default.
171
+ Will create an abstract class for the animals connection.
145
172
 
146
- Fixes #32639.
173
+ ```ruby
174
+ class AnimalsRecord < ApplicationRecord
175
+ self.abstract_class = true
147
176
 
148
- *Guillermo Iguaran*
177
+ connects_to database: { writing: :animals }
178
+ end
179
+ ```
149
180
 
150
- * Make the master.key file read-only for the owner upon generation on
151
- POSIX-compliant systems.
181
+ And generate a `Pet` model that inherits from the new `AnimalsRecord`:
152
182
 
153
- Previously:
183
+ ```ruby
184
+ class Pet < AnimalsRecord
185
+ end
186
+ ```
154
187
 
155
- $ ls -l config/master.key
156
- -rw-r--r-- 1 owner group 32 Jan 1 00:00 master.key
188
+ If you already have an abstract class and it follows a different pattern than Rails defaults, you can pass a parent class with the database argument.
157
189
 
158
- Now:
190
+ ```bash
191
+ $ bin/rails generate scaffold Pet name:string --database=animals --parent=SecondaryBase
192
+ ```
159
193
 
160
- $ ls -l config/master.key
161
- -rw------- 1 owner group 32 Jan 1 00:00 master.key
194
+ This will ensure the model inherits from the `SecondaryBase` parent instead of `AnimalsRecord`
162
195
 
163
- Fixes #32604.
196
+ ```ruby
197
+ class Pet < SecondaryBase
198
+ end
199
+ ```
164
200
 
165
- *Jose Luis Duran*
201
+ *Eileen M. Uchitelle*, *John Crepezzi*
166
202
 
167
- * Allow use of `minitest-rails` gem with Rails test runner.
203
+ * Accept params from url to prepopulate the Inbound Emails form in Rails conductor.
168
204
 
169
- Fixes #31324.
205
+ *Chris Oliver*
170
206
 
171
- *Yuji Yaginuma*
207
+ * Create a new rails app using a minimal stack.
208
+
209
+ `rails new cool_app --minimal`
210
+
211
+ All the following are excluded from your minimal stack:
212
+
213
+ - action_cable
214
+ - action_mailbox
215
+ - action_mailer
216
+ - action_text
217
+ - active_job
218
+ - active_storage
219
+ - bootsnap
220
+ - jbuilder
221
+ - spring
222
+ - system_tests
223
+ - turbolinks
224
+ - webpack
225
+
226
+ *Haroon Ahmed*, *DHH*
227
+
228
+ * Add default ENV variable option with BACKTRACE to turn off backtrace cleaning when debugging framework code in the
229
+ generated config/initializers/backtrace_silencers.rb.
230
+
231
+ `BACKTRACE=1 ./bin/rails runner "MyClass.perform"`
172
232
 
233
+ *DHH*
173
234
 
174
- ## Rails 5.2.0 (April 09, 2018) ##
235
+ * The autoloading guide for Zeitwerk mode documents how to autoload classes
236
+ during application boot in a safe way.
175
237
 
176
- * Fix minitest rails plugin.
238
+ *Haroon Ahmed*, *Xavier Noria*
177
239
 
178
- The custom reporters are added only if needed.
240
+ * The `classic` autoloader starts its deprecation cycle.
179
241
 
180
- This will fix conflicts with others plugins.
242
+ New Rails projects are strongly discouraged from using `classic`, and we recommend that existing projects running on `classic` switch to `zeitwerk` mode when upgrading. Please check the [_Upgrading Ruby on Rails_](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html) guide for tips.
181
243
 
182
- *Kevin Robatel*
244
+ *Xavier Noria*
183
245
 
184
- * Deprecate `after_bundle` callback in Rails plugin templates.
246
+ * Adds `rails test:all` for running all tests in the test directory.
247
+
248
+ This runs all test files in the test directory, including system tests.
249
+
250
+ *Niklas Häusele*
251
+
252
+ * Add `config.generators.after_generate` for processing to generated files.
253
+
254
+ Register a callback that will get called right after generators has finished.
185
255
 
186
256
  *Yuji Yaginuma*
187
257
 
188
- * `rails new` and `rails plugin new` get `Active Storage` by default.
189
- Add ability to skip `Active Storage` with `--skip-active-storage`
190
- and do so automatically when `--skip-active-record` is used.
258
+ * Make test file patterns configurable via Environment variables
191
259
 
192
- *bogdanvlviv*
260
+ This makes test file patterns configurable via two environment variables:
261
+ `DEFAULT_TEST`, to configure files to test, and `DEFAULT_TEST_EXCLUDE`,
262
+ to configure files to exclude from testing.
193
263
 
194
- * Gemfile for new apps: upgrade redis-rb from ~> 3.0 to 4.0.
264
+ These values were hardcoded before, which made it difficult to add
265
+ new categories of tests that should not be executed by default (e.g:
266
+ smoke tests).
195
267
 
196
- *Jeremy Daer*
268
+ *Jorge Manrubia*
197
269
 
198
- * Add `mini_magick` to default `Gemfile` as comment.
270
+ * No longer include `rake rdoc` task when generating plugins.
199
271
 
200
- *Yoshiyuki Hirano*
272
+ To generate docs, use the `rdoc lib` command instead.
201
273
 
202
- * Derive `secret_key_base` from the app name in development and test environments.
274
+ *Jonathan Hefner*
203
275
 
204
- Spares away needless secret configs.
276
+ * Allow relative paths with trailing slashes to be passed to `rails test`.
205
277
 
206
- *DHH*, *Kasper Timm Hansen*
278
+ *Eugene Kenny*
207
279
 
208
- * Support multiple versions arguments for `gem` method of Generators.
280
+ * Add `rack-mini-profiler` gem to the default `Gemfile`.
209
281
 
210
- *Yoshiyuki Hirano*
282
+ `rack-mini-profiler` displays performance information such as SQL time and flame graphs.
283
+ It's enabled by default in development environment, but can be enabled in production as well.
284
+ See the gem [README](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md) for information on how to enable it in production.
211
285
 
212
- * Add `--skip-yarn` option to the plugin generator.
286
+ *Osama Sayegh*
213
287
 
214
- *bogdanvlviv*
288
+ * `rails stats` will now count TypeScript files toward JavaScript stats.
215
289
 
216
- * Optimize routes indentation.
290
+ *Joshua Cody*
217
291
 
218
- *Yoshiyuki Hirano*
292
+ * Run `git init` when generating plugins.
219
293
 
220
- * Optimize indentation for generator actions.
294
+ Opt out with `--skip-git`.
221
295
 
222
- *Yoshiyuki Hirano*
296
+ *OKURA Masafumi*
223
297
 
224
- * Skip unused components when running `bin/rails` in Rails plugin.
298
+ * Add benchmark generator.
225
299
 
226
- *Yoshiyuki Hirano*
300
+ Introduce benchmark generator to benchmark Rails applications.
227
301
 
228
- * Add `git_source` to `Gemfile` for plugin generator.
302
+ `rails generate benchmark opt_compare`
229
303
 
230
- *Yoshiyuki Hirano*
304
+ This creates a benchmark file that uses [`benchmark-ips`](https://github.com/evanphx/benchmark-ips).
305
+ By default, two code blocks can be benchmarked using the `before` and `after` reports.
231
306
 
232
- * Add `--skip-action-cable` option to the plugin generator.
307
+ You can run the generated benchmark file using:
308
+ `ruby script/benchmarks/opt_compare.rb`
233
309
 
234
- *bogdanvlviv*
310
+ *Kevin Jalbert*, *Gannon McGibbon*
235
311
 
236
- * Deprecate support for using a `Rails::Application` subclass to start Rails server.
312
+ * Cache compiled view templates when running tests by default.
237
313
 
238
- *Yuji Yaginuma*
314
+ When generating a new app without `--skip-spring`, caching classes is
315
+ disabled in `environments/test.rb`. This implicitly disables caching
316
+ view templates too. This change will enable view template caching by
317
+ adding this to the generated `environments/test.rb`:
239
318
 
240
- * Add `ruby x.x.x` version to `Gemfile` and create `.ruby-version`
241
- root file containing the current Ruby version when new Rails applications are
242
- created.
319
+ ```ruby
320
+ config.action_view.cache_template_loading = true
321
+ ```
243
322
 
244
- *Alberto Almagro*
323
+ *Jorge Manrubia*
245
324
 
246
- * Support `-` as a platform-agnostic way to run a script from stdin with
247
- `rails runner`
325
+ * Introduce middleware move operations.
248
326
 
249
- *Cody Cutrer*
327
+ With this change, you no longer need to delete and reinsert a middleware to
328
+ move it from one place to another in the stack:
250
329
 
251
- * Add `bootsnap` to default `Gemfile`.
330
+ ```ruby
331
+ config.middleware.move_before ActionDispatch::Flash, Magical::Unicorns
332
+ ```
252
333
 
253
- *Burke Libbey*
334
+ This will move the `Magical::Unicorns` middleware before
335
+ `ActionDispatch::Flash`. You can also move it after with:
254
336
 
255
- * Properly expand shortcuts for environment's name running the `console`
256
- and `dbconsole` commands.
337
+ ```ruby
338
+ config.middleware.move_after ActionDispatch::Flash, Magical::Unicorns
339
+ ```
257
340
 
258
- *Robin Dupret*
341
+ *Genadi Samokovarov*
259
342
 
260
- * Passing the environment's name as a regular argument to the
261
- `rails dbconsole` and `rails console` commands is deprecated.
262
- The `-e` option should be used instead.
343
+ * Generators that inherit from NamedBase respect `--force` option.
263
344
 
264
- Previously:
345
+ *Josh Brody*
265
346
 
266
- $ bin/rails dbconsole production
347
+ * Allow configuration of eager_load behaviour for rake environment:
267
348
 
268
- Now:
349
+ config.rake_eager_load
269
350
 
270
- $ bin/rails dbconsole -e production
351
+ Defaults to `false` as per previous behaviour.
271
352
 
272
- *Robin Dupret*, *Kasper Timm Hansen*
353
+ *Thierry Joyal*
273
354
 
274
- * Allow passing a custom connection name to the `rails dbconsole`
275
- command when using a 3-level database configuration.
355
+ * Ensure Rails migration generator respects system-wide primary key config.
276
356
 
277
- $ bin/rails dbconsole -c replica
357
+ When rails is configured to use a specific primary key type:
278
358
 
279
- *Robin Dupret*, *Jeremy Daer*
359
+ ```ruby
360
+ config.generators do |g|
361
+ g.orm :active_record, primary_key_type: :uuid
362
+ end
363
+ ```
280
364
 
281
- * Skip unused components when running `bin/rails app:update`.
365
+ Previously:
282
366
 
283
- If the initial app generation skipped Action Cable, Active Record etc.,
284
- the update task honors those skips too.
367
+ ```bash
368
+ $ bin/rails g migration add_location_to_users location:references
369
+ ```
285
370
 
286
- *Yuji Yaginuma*
371
+ The references line in the migration would not have `type: :uuid`.
372
+ This change causes the type to be applied appropriately.
287
373
 
288
- * Make Rails' test runner work better with minitest plugins.
374
+ *Louis-Michel Couture*, *Dermot Haughey*
289
375
 
290
- By demoting the Rails test runner to just another minitest plugin —
291
- and thereby not eager loading it — we can co-exist much better with
292
- other minitest plugins such as pride and minitest-focus.
376
+ * Deprecate `Rails::DBConsole#config`.
293
377
 
294
- *Kasper Timm Hansen*
378
+ `Rails::DBConsole#config` is deprecated without replacement. Use `Rails::DBConsole.db_config.configuration_hash` instead.
295
379
 
296
- * Load environment file in `dbconsole` command.
380
+ *Eileen M. Uchitelle*, *John Crepezzi*
297
381
 
298
- Fixes #29717.
382
+ * `Rails.application.config_for` merges shared configuration deeply.
299
383
 
300
- *Yuji Yaginuma*
384
+ ```yaml
385
+ # config/example.yml
386
+ shared:
387
+ foo:
388
+ bar:
389
+ baz: 1
390
+ development:
391
+ foo:
392
+ bar:
393
+ qux: 2
394
+ ```
301
395
 
302
- * Add `rails secrets:show` command.
396
+ ```ruby
397
+ # Previously
398
+ Rails.application.config_for(:example)[:foo][:bar] #=> { qux: 2 }
303
399
 
304
- *Yuji Yaginuma*
400
+ # Now
401
+ Rails.application.config_for(:example)[:foo][:bar] #=> { baz: 1, qux: 2 }
402
+ ```
305
403
 
306
- * Allow mounting the same engine several times in different locations.
404
+ *Yuhei Kiriyama*
307
405
 
308
- Fixes #20204.
406
+ * Remove access to values in nested hashes returned by `Rails.application.config_for` via String keys.
309
407
 
310
- *David Rodríguez*
408
+ ```yaml
409
+ # config/example.yml
410
+ development:
411
+ options:
412
+ key: value
413
+ ```
311
414
 
312
- * Clear screenshot files in `tmp:clear` task.
415
+ ```ruby
416
+ Rails.application.config_for(:example).options
417
+ ```
313
418
 
314
- *Yuji Yaginuma*
419
+ This used to return a Hash on which you could access values with String keys. This was deprecated in 6.0, and now doesn't work anymore.
315
420
 
316
- * Add `railtie.rb` to the plugin generator
421
+ *Étienne Barrié*
317
422
 
318
- *Tsukuru Tanimichi*
423
+ * Configuration files for environments (`config/environments/*.rb`) are
424
+ now able to modify `autoload_paths`, `autoload_once_paths`, and
425
+ `eager_load_paths`.
319
426
 
320
- * Deprecate `capify!` method in generators and templates.
427
+ As a consequence, applications cannot autoload within those files. Before, they technically could, but changes in autoloaded classes or modules had no effect anyway in the configuration because reloading does not reboot.
321
428
 
322
- *Yuji Yaginuma*
429
+ Ways to use application code in these files:
323
430
 
324
- * Allow irb options to be passed from `rails console` command.
431
+ * Define early in the boot process a class that is not reloadable, from which the application takes configuration values that get passed to the framework.
325
432
 
326
- Fixes #28988.
433
+ ```ruby
434
+ # In config/application.rb, for example.
435
+ require "#{Rails.root}/lib/my_app/config"
327
436
 
328
- *Yuji Yaginuma*
437
+ # In config/environments/development.rb, for example.
438
+ config.foo = MyApp::Config.foo
439
+ ```
440
+
441
+ * If the class has to be reloadable, then wrap the configuration code in a `to_prepare` block:
442
+
443
+ ```ruby
444
+ config.to_prepare do
445
+ config.foo = MyModel.foo
446
+ end
447
+ ```
329
448
 
330
- * Added a shared section to `config/database.yml` that will be loaded for all environments.
449
+ That assigns the latest `MyModel.foo` to `config.foo` when the application boots, and each time there is a reload. But whether that has an effect or not depends on the configuration point, since it is not uncommon for engines to read the application configuration during initialization and set their own state from them. That process happens only on boot, not on reloads, and if that is how `config.foo` worked, resetting it would have no effect in the state of the engine.
331
450
 
332
- *Pierre Schambacher*
451
+ *Allen Hsu* & *Xavier Noria*
333
452
 
334
- * Namespace error pages' CSS selectors to stop the styles from bleeding into other pages
335
- when using Turbolinks.
453
+ * Support using environment variable to set pidfile.
336
454
 
337
- *Jan Krutisch*
455
+ *Ben Thorner*
338
456
 
339
457
 
340
- Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/railties/CHANGELOG.md) for previous changes.
458
+ Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/railties/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2018 David Heinemeier Hansson
1
+ Copyright (c) 2004-2020 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