railties 5.2.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +293 -89
  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 +24 -13
  7. data/lib/rails/all.rb +4 -0
  8. data/lib/rails/api/generator.rb +2 -1
  9. data/lib/rails/api/task.rb +17 -0
  10. data/lib/rails/app_loader.rb +2 -2
  11. data/lib/rails/app_updater.rb +4 -1
  12. data/lib/rails/application/bootstrap.rb +9 -17
  13. data/lib/rails/application/configuration.rb +177 -27
  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 +69 -2
  17. data/lib/rails/application/routes_reloader.rb +9 -19
  18. data/lib/rails/application.rb +96 -66
  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/actions.rb +10 -0
  25. data/lib/rails/command/base.rb +17 -5
  26. data/lib/rails/command/behavior.rb +8 -49
  27. data/lib/rails/command/environment_argument.rb +9 -16
  28. data/lib/rails/command/spellchecker.rb +57 -0
  29. data/lib/rails/command.rb +18 -11
  30. data/lib/rails/commands/console/console_command.rb +6 -0
  31. data/lib/rails/commands/credentials/USAGE +33 -0
  32. data/lib/rails/commands/credentials/credentials_command/diffing.rb +41 -0
  33. data/lib/rails/commands/credentials/credentials_command.rb +78 -21
  34. data/lib/rails/commands/db/system/change/change_command.rb +25 -0
  35. data/lib/rails/commands/dbconsole/dbconsole_command.rb +66 -51
  36. data/lib/rails/commands/dev/dev_command.rb +19 -0
  37. data/lib/rails/commands/encrypted/USAGE +28 -0
  38. data/lib/rails/commands/encrypted/encrypted_command.rb +5 -4
  39. data/lib/rails/commands/generate/generate_command.rb +1 -1
  40. data/lib/rails/commands/help/help_command.rb +1 -1
  41. data/lib/rails/commands/initializers/initializers_command.rb +23 -0
  42. data/lib/rails/commands/new/new_command.rb +2 -2
  43. data/lib/rails/commands/notes/notes_command.rb +29 -0
  44. data/lib/rails/commands/plugin/plugin_command.rb +1 -1
  45. data/lib/rails/commands/rake/rake_command.rb +9 -8
  46. data/lib/rails/commands/routes/routes_command.rb +37 -0
  47. data/lib/rails/commands/runner/runner_command.rb +13 -9
  48. data/lib/rails/commands/secrets/USAGE +6 -0
  49. data/lib/rails/commands/secrets/secrets_command.rb +3 -3
  50. data/lib/rails/commands/server/server_command.rb +92 -56
  51. data/lib/rails/commands/test/test_command.rb +2 -2
  52. data/lib/rails/configuration.rb +48 -19
  53. data/lib/rails/engine/configuration.rb +6 -2
  54. data/lib/rails/engine/updater.rb +1 -1
  55. data/lib/rails/engine.rb +63 -35
  56. data/lib/rails/gem_version.rb +2 -2
  57. data/lib/rails/generators/actions/create_migration.rb +5 -1
  58. data/lib/rails/generators/actions.rb +89 -56
  59. data/lib/rails/generators/app_base.rb +80 -108
  60. data/lib/rails/generators/app_name.rb +50 -0
  61. data/lib/rails/generators/base.rb +19 -12
  62. data/lib/rails/generators/database.rb +57 -0
  63. data/lib/rails/generators/erb/mailer/mailer_generator.rb +1 -2
  64. data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +0 -1
  65. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +7 -4
  66. data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +1 -1
  67. data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +9 -1
  68. data/lib/rails/generators/erb.rb +0 -1
  69. data/lib/rails/generators/generated_attribute.rb +50 -31
  70. data/lib/rails/generators/migration.rb +3 -3
  71. data/lib/rails/generators/model_helpers.rb +33 -2
  72. data/lib/rails/generators/named_base.rb +3 -7
  73. data/lib/rails/generators/rails/app/USAGE +2 -1
  74. data/lib/rails/generators/rails/app/app_generator.rb +127 -84
  75. data/lib/rails/generators/rails/app/templates/Gemfile.tt +18 -21
  76. data/lib/rails/generators/rails/app/templates/Rakefile.tt +1 -1
  77. data/lib/rails/generators/rails/app/templates/app/assets/config/manifest.js.tt +0 -3
  78. data/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js +6 -0
  79. data/lib/rails/generators/rails/app/templates/app/javascript/channels/index.js +5 -0
  80. data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +23 -0
  81. data/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt +5 -0
  82. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +6 -5
  83. data/lib/rails/generators/rails/app/templates/bin/rails.tt +5 -2
  84. data/lib/rails/generators/rails/app/templates/bin/rake.tt +5 -2
  85. data/lib/rails/generators/rails/app/templates/bin/setup.tt +9 -9
  86. data/lib/rails/generators/rails/app/templates/bin/spring.tt +9 -0
  87. data/lib/rails/generators/rails/app/templates/bin/yarn.tt +11 -3
  88. data/lib/rails/generators/rails/app/templates/config/application.rb.tt +16 -7
  89. data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +2 -2
  90. data/lib/rails/generators/rails/app/templates/config/cable.yml.tt +1 -1
  91. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +4 -5
  92. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +12 -11
  93. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +13 -12
  94. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +1 -1
  95. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +13 -12
  96. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +12 -11
  97. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +16 -15
  98. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +1 -1
  99. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +11 -10
  100. data/lib/rails/generators/rails/app/templates/config/environment.rb.tt +1 -1
  101. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +22 -5
  102. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +43 -17
  103. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +26 -7
  104. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +1 -1
  105. data/lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb.tt +4 -3
  106. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +7 -0
  107. data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +3 -1
  108. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +63 -0
  109. data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +11 -0
  110. data/lib/rails/generators/rails/app/templates/config/locales/en.yml +1 -1
  111. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +13 -4
  112. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +1 -1
  113. data/lib/rails/generators/rails/app/templates/config/spring.rb.tt +6 -6
  114. data/lib/rails/generators/rails/app/templates/config.ru.tt +2 -1
  115. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +1 -1
  116. data/lib/rails/generators/rails/app/templates/gitattributes.tt +14 -0
  117. data/lib/rails/generators/rails/app/templates/gitignore.tt +10 -7
  118. data/lib/rails/generators/rails/app/templates/package.json.tt +8 -2
  119. data/lib/rails/generators/rails/app/templates/public/robots.txt +1 -1
  120. data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -1
  121. data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +11 -0
  122. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +9 -2
  123. data/lib/rails/generators/rails/assets/USAGE +3 -7
  124. data/lib/rails/generators/rails/assets/assets_generator.rb +0 -1
  125. data/lib/rails/generators/rails/benchmark/USAGE +19 -0
  126. data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +29 -0
  127. data/lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt +15 -0
  128. data/lib/rails/generators/rails/controller/USAGE +2 -2
  129. data/lib/rails/generators/rails/controller/controller_generator.rb +10 -39
  130. data/lib/rails/generators/rails/credentials/credentials_generator.rb +6 -7
  131. data/lib/rails/generators/rails/db/system/change/change_generator.rb +65 -0
  132. data/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb +10 -7
  133. data/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +1 -0
  134. data/lib/rails/generators/rails/generator/USAGE +2 -2
  135. data/lib/rails/generators/rails/generator/generator_generator.rb +0 -1
  136. data/lib/rails/generators/rails/generator/templates/USAGE.tt +1 -1
  137. data/lib/rails/generators/rails/helper/USAGE +2 -3
  138. data/lib/rails/generators/rails/helper/helper_generator.rb +5 -0
  139. data/lib/rails/generators/rails/integration_test/USAGE +2 -2
  140. data/lib/rails/generators/rails/migration/USAGE +4 -4
  141. data/lib/rails/generators/rails/model/USAGE +15 -16
  142. data/lib/rails/generators/rails/plugin/plugin_generator.rb +32 -56
  143. data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +18 -18
  144. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +3 -10
  145. data/lib/rails/generators/rails/plugin/templates/Rakefile.tt +4 -18
  146. data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +1 -2
  147. data/lib/rails/generators/rails/plugin/templates/app/helpers/%namespaced_name%/application_helper.rb.tt +1 -1
  148. data/lib/rails/generators/rails/plugin/templates/app/jobs/%namespaced_name%/application_job.rb.tt +1 -1
  149. data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +1 -1
  150. data/lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt +1 -1
  151. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +3 -3
  152. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +14 -11
  153. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +1 -1
  154. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/railtie.rb.tt +1 -1
  155. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%.rb.tt +1 -0
  156. data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +1 -1
  157. data/lib/rails/generators/rails/plugin/templates/test/%namespaced_name%_test.rb.tt +4 -4
  158. data/lib/rails/generators/rails/plugin/templates/test/integration/navigation_test.rb.tt +1 -1
  159. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +0 -4
  160. data/lib/rails/generators/rails/resource/USAGE +4 -4
  161. data/lib/rails/generators/rails/resource_route/resource_route_generator.rb +2 -27
  162. data/lib/rails/generators/rails/scaffold/USAGE +5 -5
  163. data/lib/rails/generators/rails/scaffold_controller/USAGE +2 -2
  164. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +19 -0
  165. data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +2 -2
  166. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +2 -2
  167. data/lib/rails/generators/rails/system_test/USAGE +2 -2
  168. data/lib/rails/generators/rails/task/USAGE +3 -3
  169. data/lib/rails/generators/resource_helpers.rb +1 -6
  170. data/lib/rails/generators/test_case.rb +1 -1
  171. data/lib/rails/generators/test_unit/controller/controller_generator.rb +2 -0
  172. data/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt +3 -3
  173. data/lib/rails/generators/test_unit/generator/generator_generator.rb +0 -1
  174. data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +2 -2
  175. data/lib/rails/generators/test_unit/integration/integration_generator.rb +5 -0
  176. data/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt +1 -1
  177. data/lib/rails/generators/test_unit/job/job_generator.rb +5 -0
  178. data/lib/rails/generators/test_unit/job/templates/unit_test.rb.tt +1 -1
  179. data/lib/rails/generators/test_unit/mailer/mailer_generator.rb +1 -1
  180. data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +1 -1
  181. data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +3 -3
  182. data/lib/rails/generators/test_unit/model/templates/unit_test.rb.tt +1 -1
  183. data/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +1 -1
  184. data/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +2 -2
  185. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +12 -3
  186. data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +1 -1
  187. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +1 -1
  188. data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +10 -2
  189. data/lib/rails/generators/test_unit/system/system_generator.rb +5 -0
  190. data/lib/rails/generators/testing/assertions.rb +2 -2
  191. data/lib/rails/generators/testing/behaviour.rb +4 -2
  192. data/lib/rails/generators.rb +38 -24
  193. data/lib/rails/info.rb +4 -4
  194. data/lib/rails/info_controller.rb +2 -3
  195. data/lib/rails/mailers_controller.rb +10 -4
  196. data/lib/rails/paths.rb +26 -10
  197. data/lib/rails/rack/logger.rb +5 -6
  198. data/lib/rails/railtie/configurable.rb +0 -1
  199. data/lib/rails/railtie/configuration.rb +3 -3
  200. data/lib/rails/railtie.rb +33 -13
  201. data/lib/rails/ruby_version_check.rb +3 -3
  202. data/lib/rails/secrets.rb +0 -1
  203. data/lib/rails/source_annotation_extractor.rb +124 -117
  204. data/lib/rails/tasks/engine.rake +1 -4
  205. data/lib/rails/tasks/framework.rake +13 -3
  206. data/lib/rails/tasks/log.rake +0 -1
  207. data/lib/rails/tasks/misc.rake +1 -1
  208. data/lib/rails/tasks/statistics.rake +5 -1
  209. data/lib/rails/tasks/yarn.rake +14 -1
  210. data/lib/rails/tasks/zeitwerk.rake +69 -0
  211. data/lib/rails/tasks.rb +1 -4
  212. data/lib/rails/templates/rails/mailers/email.html.erb +11 -7
  213. data/lib/rails/templates/rails/welcome/index.html.erb +3 -3
  214. data/lib/rails/test_help.rb +11 -9
  215. data/lib/rails/test_unit/reporter.rb +3 -2
  216. data/lib/rails/test_unit/runner.rb +25 -8
  217. data/lib/rails/test_unit/testing.rake +7 -1
  218. data/lib/rails.rb +10 -8
  219. metadata +45 -39
  220. data/lib/rails/generators/js/assets/assets_generator.rb +0 -15
  221. data/lib/rails/generators/js/assets/templates/javascript.js +0 -2
  222. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +0 -22
  223. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.js.tt +0 -13
  224. data/lib/rails/generators/rails/app/templates/bin/bundle.tt +0 -2
  225. data/lib/rails/generators/rails/app/templates/bin/update.tt +0 -34
  226. data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt +0 -50
  227. data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt +0 -86
  228. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_2.rb.tt +0 -35
  229. data/lib/rails/generators/rails/assets/templates/javascript.js +0 -2
  230. data/lib/rails/generators/rails/plugin/templates/rails/application.rb.tt +0 -23
  231. data/lib/rails/tasks/annotations.rake +0 -22
  232. data/lib/rails/tasks/dev.rake +0 -10
  233. data/lib/rails/tasks/initializers.rake +0 -8
  234. data/lib/rails/tasks/routes.rake +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25be2ea21e6618d4a5c4925a8e2bc17a1085268558eddf1fbac80bfe19c08b08
4
- data.tar.gz: 1ff96ab5e5d5822bbbc11b87e3acd71ae326fc18e24c1f8173c9393cd61a8746
3
+ metadata.gz: 1adfe379d94049a35a1306f22a5d1368e3b88455d57bb1e4764b845f7ec7e0c5
4
+ data.tar.gz: 1ff026a5d1cc46e2cb543b15568fb2f12915d468a3c3723efd2daa18d70fc04a
5
5
  SHA512:
6
- metadata.gz: 1585f8b3b3ea57f8350b894e6129b09bdfc518c4bbce249ca048fa832585334d4238e654bec9c6eecb4c3c6f9459299e70f2ea0a07704d8118e2c508eac9176c
7
- data.tar.gz: 73b84a73871f51ae45113565928eec4321119c0aa8260498cee99c534d35325c94197033d5a8f0451fdd859e4a2c43f8a20119e72b2586ddb56b465da0516380
6
+ metadata.gz: 1b297610d901f515027eb7bb31b3bf912437ccc0643276ba5b166216fe41f8f6e74b42783002d8bd1a904fa512b18ffbcb258375d019299918a21c5b6c220cf6
7
+ data.tar.gz: 9b1c0e55db347c811b93edb2e68dee00b99cd476e917de5e138c09faa4eaaaa1df3a374bc54b09934895c22993080e327d530129ba4163f209cd42d438deaabe
data/CHANGELOG.md CHANGED
@@ -1,167 +1,371 @@
1
- ## Rails 5.2.0 (April 09, 2018) ##
1
+ ## Rails 6.1.0 (December 09, 2020) ##
2
2
 
3
- * Fix minitest rails plugin.
3
+ * Added `Railtie#server` hook called when Rails starts a server.
4
+ This is useful in case your application or a library needs to run
5
+ another process next to the Rails server. This is quite common in development
6
+ for instance to run the Webpack or the React server.
4
7
 
5
- The custom reporters are added only if needed.
8
+ It can be used like this:
6
9
 
7
- This will fix conflicts with others plugins.
10
+ ```ruby
11
+ class MyRailtie < Rails::Railtie
12
+ server do
13
+ WebpackServer.run
14
+ end
15
+ end
16
+ ```
8
17
 
9
- *Kevin Robatel*
18
+ *Edouard Chin*
10
19
 
11
- * Deprecate `after_bundle` callback in Rails plugin templates.
20
+ * Remove deprecated `rake dev:cache` tasks.
12
21
 
13
- *Yuji Yaginuma*
22
+ *Rafael Mendonça França*
14
23
 
15
- * `rails new` and `rails plugin new` get `Active Storage` by default.
16
- Add ability to skip `Active Storage` with `--skip-active-storage`
17
- and do so automatically when `--skip-active-record` is used.
24
+ * Remove deprecated `rake routes` tasks.
18
25
 
19
- *bogdanvlviv*
26
+ *Rafael Mendonça França*
20
27
 
21
- * Gemfile for new apps: upgrade redis-rb from ~> 3.0 to 4.0.
28
+ * Remove deprecated `rake initializers` tasks.
22
29
 
23
- *Jeremy Daer*
30
+ *Rafael Mendonça França*
24
31
 
25
- * Add `mini_magick` to default `Gemfile` as comment.
32
+ * Remove deprecated support for using the `HOST` environment variable to specify the server IP.
26
33
 
27
- *Yoshiyuki Hirano*
34
+ *Rafael Mendonça França*
28
35
 
29
- * Derive `secret_key_base` from the app name in development and test environments.
36
+ * Remove deprecated `server` argument from the rails server command.
30
37
 
31
- Spares away needless secret configs.
38
+ *Rafael Mendonça França*
32
39
 
33
- *DHH*, *Kasper Timm Hansen*
40
+ * Remove deprecated `SOURCE_ANNOTATION_DIRECTORIES` environment variable support from `rails notes`.
34
41
 
35
- * Support multiple versions arguments for `gem` method of Generators.
42
+ *Rafael Mendonça França*
36
43
 
37
- *Yoshiyuki Hirano*
44
+ * Remove deprecated `connection` option in the `rails dbconsole` command.
38
45
 
39
- * Add `--skip-yarn` option to the plugin generator.
46
+ *Rafael Mendonça França*
40
47
 
41
- *bogdanvlviv*
48
+ * Remove depreated `rake notes` tasks.
42
49
 
43
- * Optimize routes indentation.
50
+ *Rafael Mendonça França*
44
51
 
45
- *Yoshiyuki Hirano*
52
+ * Return a 405 Method Not Allowed response when a request uses an unknown HTTP method.
46
53
 
47
- * Optimize indentation for generator actions.
54
+ Fixes #38998.
48
55
 
49
- *Yoshiyuki Hirano*
56
+ *Loren Norman*
50
57
 
51
- * Skip unused components when running `bin/rails` in Rails plugin.
58
+ * Make railsrc file location xdg-specification compliant
52
59
 
53
- *Yoshiyuki Hirano*
60
+ `rails new` will now look for the default `railsrc` file at
61
+ `$XDG_CONFIG_HOME/rails/railsrc` (or `~/.config/rails/railsrc` if
62
+ `XDG_CONFIG_HOME` is not set). If this file does not exist, `rails new`
63
+ will fall back to `~/.railsrc`.
54
64
 
55
- * Add `git_source` to `Gemfile` for plugin generator.
65
+ The fallback behaviour means this does not cause any breaking changes.
56
66
 
57
- *Yoshiyuki Hirano*
67
+ *Nick Wolf*
58
68
 
59
- * Add `--skip-action-cable` option to the plugin generator.
69
+ * Change the default logging level from :debug to :info to avoid inadvertent exposure of personally
70
+ identifiable information (PII) in production environments.
60
71
 
61
- *bogdanvlviv*
72
+ *Eric M. Payne*
62
73
 
63
- * Deprecate support for using a `Rails::Application` subclass to start Rails server.
74
+ * Automatically generate abstract class when using multiple databases.
64
75
 
65
- *Yuji Yaginuma*
76
+ 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.
66
77
 
67
- * Add `ruby x.x.x` version to `Gemfile` and create `.ruby-version`
68
- root file containing the current Ruby version when new Rails applications are
69
- created.
78
+ Usage:
70
79
 
71
- *Alberto Almagro*
80
+ ```bash
81
+ $ bin/rails generate scaffold Pet name:string --database=animals
82
+ ```
72
83
 
73
- * Support `-` as a platform-agnostic way to run a script from stdin with
74
- `rails runner`
84
+ Will create an abstract class for the animals connection.
75
85
 
76
- *Cody Cutrer*
86
+ ```ruby
87
+ class AnimalsRecord < ApplicationRecord
88
+ self.abstract_class = true
77
89
 
78
- * Add `bootsnap` to default `Gemfile`.
90
+ connects_to database: { writing: :animals }
91
+ end
92
+ ```
79
93
 
80
- *Burke Libbey*
94
+ And generate a `Pet` model that inherits from the new `AnimalsRecord`:
81
95
 
82
- * Properly expand shortcuts for environment's name running the `console`
83
- and `dbconsole` commands.
96
+ ```ruby
97
+ class Pet < AnimalsRecord
98
+ end
99
+ ```
84
100
 
85
- *Robin Dupret*
101
+ 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.
86
102
 
87
- * Passing the environment's name as a regular argument to the
88
- `rails dbconsole` and `rails console` commands is deprecated.
89
- The `-e` option should be used instead.
103
+ ```bash
104
+ $ bin/rails generate scaffold Pet name:string --database=animals --parent=SecondaryBase
105
+ ```
90
106
 
91
- Previously:
107
+ This will ensure the model inherits from the `SecondaryBase` parent instead of `AnimalsRecord`
92
108
 
93
- $ bin/rails dbconsole production
109
+ ```ruby
110
+ class Pet < SecondaryBase
111
+ end
112
+ ```
94
113
 
95
- Now:
114
+ *Eileen M. Uchitelle*, *John Crepezzi*
96
115
 
97
- $ bin/rails dbconsole -e production
116
+ * Accept params from url to prepopulate the Inbound Emails form in Rails conductor.
98
117
 
99
- *Robin Dupret*, *Kasper Timm Hansen*
118
+ *Chris Oliver*
100
119
 
101
- * Allow passing a custom connection name to the `rails dbconsole`
102
- command when using a 3-level database configuration.
120
+ * Create a new rails app using a minimal stack.
103
121
 
104
- $ bin/rails dbconsole -c replica
122
+ `rails new cool_app --minimal`
105
123
 
106
- *Robin Dupret*, *Jeremy Daer*
124
+ All the following are excluded from your minimal stack:
107
125
 
108
- * Skip unused components when running `bin/rails app:update`.
126
+ - action_cable
127
+ - action_mailbox
128
+ - action_mailer
129
+ - action_text
130
+ - active_job
131
+ - active_storage
132
+ - bootsnap
133
+ - jbuilder
134
+ - spring
135
+ - system_tests
136
+ - turbolinks
137
+ - webpack
109
138
 
110
- If the initial app generation skipped Action Cable, Active Record etc.,
111
- the update task honors those skips too.
139
+ *Haroon Ahmed*, *DHH*
112
140
 
113
- *Yuji Yaginuma*
141
+ * Add default ENV variable option with BACKTRACE to turn off backtrace cleaning when debugging framework code in the
142
+ generated config/initializers/backtrace_silencers.rb.
114
143
 
115
- * Make Rails' test runner work better with minitest plugins.
144
+ `BACKTRACE=1 ./bin/rails runner "MyClass.perform"`
116
145
 
117
- By demoting the Rails test runner to just another minitest plugin —
118
- and thereby not eager loading it — we can co-exist much better with
119
- other minitest plugins such as pride and minitest-focus.
146
+ *DHH*
120
147
 
121
- *Kasper Timm Hansen*
148
+ * The autoloading guide for Zeitwerk mode documents how to autoload classes
149
+ during application boot in a safe way.
122
150
 
123
- * Load environment file in `dbconsole` command.
151
+ *Haroon Ahmed*, *Xavier Noria*
124
152
 
125
- Fixes #29717.
153
+ * The `classic` autoloader starts its deprecation cycle.
126
154
 
127
- *Yuji Yaginuma*
155
+ 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.
128
156
 
129
- * Add `rails secrets:show` command.
157
+ *Xavier Noria*
130
158
 
131
- *Yuji Yaginuma*
159
+ * Adds `rails test:all` for running all tests in the test directory.
132
160
 
133
- * Allow mounting the same engine several times in different locations.
161
+ This runs all test files in the test directory, including system tests.
134
162
 
135
- Fixes #20204.
163
+ *Niklas Häusele*
136
164
 
137
- *David Rodríguez*
165
+ * Add `config.generators.after_generate` for processing to generated files.
138
166
 
139
- * Clear screenshot files in `tmp:clear` task.
167
+ Register a callback that will get called right after generators has finished.
140
168
 
141
169
  *Yuji Yaginuma*
142
170
 
143
- * Add `railtie.rb` to the plugin generator
171
+ * Make test file patterns configurable via Environment variables
144
172
 
145
- *Tsukuru Tanimichi*
173
+ This makes test file patterns configurable via two environment variables:
174
+ `DEFAULT_TEST`, to configure files to test, and `DEFAULT_TEST_EXCLUDE`,
175
+ to configure files to exclude from testing.
146
176
 
147
- * Deprecate `capify!` method in generators and templates.
177
+ These values were hardcoded before, which made it difficult to add
178
+ new categories of tests that should not be executed by default (e.g:
179
+ smoke tests).
148
180
 
149
- *Yuji Yaginuma*
181
+ *Jorge Manrubia*
150
182
 
151
- * Allow irb options to be passed from `rails console` command.
183
+ * No longer include `rake rdoc` task when generating plugins.
152
184
 
153
- Fixes #28988.
185
+ To generate docs, use the `rdoc lib` command instead.
154
186
 
155
- *Yuji Yaginuma*
187
+ *Jonathan Hefner*
188
+
189
+ * Allow relative paths with trailing slashes to be passed to `rails test`.
190
+
191
+ *Eugene Kenny*
192
+
193
+ * Add `rack-mini-profiler` gem to the default `Gemfile`.
194
+
195
+ `rack-mini-profiler` displays performance information such as SQL time and flame graphs.
196
+ It's enabled by default in development environment, but can be enabled in production as well.
197
+ See the gem [README](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md) for information on how to enable it in production.
198
+
199
+ *Osama Sayegh*
200
+
201
+ * `rails stats` will now count TypeScript files toward JavaScript stats.
202
+
203
+ *Joshua Cody*
204
+
205
+ * Run `git init` when generating plugins.
206
+
207
+ Opt out with `--skip-git`.
208
+
209
+ *OKURA Masafumi*
210
+
211
+ * Add benchmark generator.
212
+
213
+ Introduce benchmark generator to benchmark Rails applications.
214
+
215
+ `rails generate benchmark opt_compare`
216
+
217
+ This creates a benchmark file that uses [`benchmark-ips`](https://github.com/evanphx/benchmark-ips).
218
+ By default, two code blocks can be benchmarked using the `before` and `after` reports.
219
+
220
+ You can run the generated benchmark file using:
221
+ `ruby script/benchmarks/opt_compare.rb`
222
+
223
+ *Kevin Jalbert*, *Gannon McGibbon*
224
+
225
+ * Cache compiled view templates when running tests by default.
226
+
227
+ When generating a new app without `--skip-spring`, caching classes is
228
+ disabled in `environments/test.rb`. This implicitly disables caching
229
+ view templates too. This change will enable view template caching by
230
+ adding this to the generated `environments/test.rb`:
231
+
232
+ ```ruby
233
+ config.action_view.cache_template_loading = true
234
+ ```
235
+
236
+ *Jorge Manrubia*
237
+
238
+ * Introduce middleware move operations.
239
+
240
+ With this change, you no longer need to delete and reinsert a middleware to
241
+ move it from one place to another in the stack:
242
+
243
+ ```ruby
244
+ config.middleware.move_before ActionDispatch::Flash, Magical::Unicorns
245
+ ```
246
+
247
+ This will move the `Magical::Unicorns` middleware before
248
+ `ActionDispatch::Flash`. You can also move it after with:
249
+
250
+ ```ruby
251
+ config.middleware.move_after ActionDispatch::Flash, Magical::Unicorns
252
+ ```
253
+
254
+ *Genadi Samokovarov*
255
+
256
+ * Generators that inherit from NamedBase respect `--force` option.
257
+
258
+ *Josh Brody*
259
+
260
+ * Allow configuration of eager_load behaviour for rake environment:
261
+
262
+ config.rake_eager_load
263
+
264
+ Defaults to `false` as per previous behaviour.
265
+
266
+ *Thierry Joyal*
267
+
268
+ * Ensure Rails migration generator respects system-wide primary key config.
269
+
270
+ When rails is configured to use a specific primary key type:
271
+
272
+ ```ruby
273
+ config.generators do |g|
274
+ g.orm :active_record, primary_key_type: :uuid
275
+ end
276
+ ```
277
+
278
+ Previously:
279
+
280
+ ```bash
281
+ $ bin/rails g migration add_location_to_users location:references
282
+ ```
283
+
284
+ The references line in the migration would not have `type: :uuid`.
285
+ This change causes the type to be applied appropriately.
286
+
287
+ *Louis-Michel Couture*, *Dermot Haughey*
288
+
289
+ * Deprecate `Rails::DBConsole#config`.
290
+
291
+ `Rails::DBConsole#config` is deprecated without replacement. Use `Rails::DBConsole.db_config.configuration_hash` instead.
292
+
293
+ *Eileen M. Uchitelle*, *John Crepezzi*
294
+
295
+ * `Rails.application.config_for` merges shared configuration deeply.
296
+
297
+ ```yaml
298
+ # config/example.yml
299
+ shared:
300
+ foo:
301
+ bar:
302
+ baz: 1
303
+ development:
304
+ foo:
305
+ bar:
306
+ qux: 2
307
+ ```
308
+
309
+ ```ruby
310
+ # Previously
311
+ Rails.application.config_for(:example)[:foo][:bar] #=> { qux: 2 }
312
+
313
+ # Now
314
+ Rails.application.config_for(:example)[:foo][:bar] #=> { baz: 1, qux: 2 }
315
+ ```
316
+
317
+ *Yuhei Kiriyama*
318
+
319
+ * Remove access to values in nested hashes returned by `Rails.application.config_for` via String keys.
320
+
321
+ ```yaml
322
+ # config/example.yml
323
+ development:
324
+ options:
325
+ key: value
326
+ ```
327
+
328
+ ```ruby
329
+ Rails.application.config_for(:example).options
330
+ ```
331
+
332
+ 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.
333
+
334
+ *Étienne Barrié*
335
+
336
+ * Configuration files for environments (`config/environments/*.rb`) are
337
+ now able to modify `autoload_paths`, `autoload_once_paths`, and
338
+ `eager_load_paths`.
339
+
340
+ 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.
341
+
342
+ Ways to use application code in these files:
343
+
344
+ * 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.
345
+
346
+ ```ruby
347
+ # In config/application.rb, for example.
348
+ require "#{Rails.root}/lib/my_app/config"
349
+
350
+ # In config/environments/development.rb, for example.
351
+ config.foo = MyApp::Config.foo
352
+ ```
353
+
354
+ * If the class has to be reloadable, then wrap the configuration code in a `to_prepare` block:
355
+
356
+ ```ruby
357
+ config.to_prepare do
358
+ config.foo = MyModel.foo
359
+ end
360
+ ```
156
361
 
157
- * Added a shared section to `config/database.yml` that will be loaded for all environments.
362
+ 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.
158
363
 
159
- *Pierre Schambacher*
364
+ *Allen Hsu* & *Xavier Noria*
160
365
 
161
- * Namespace error pages' CSS selectors to stop the styles from bleeding into other pages
162
- when using Turbolinks.
366
+ * Support using environment variable to set pidfile.
163
367
 
164
- *Jan Krutisch*
368
+ *Ben Thorner*
165
369
 
166
370
 
167
- Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/railties/CHANGELOG.md) for previous changes.
371
+ 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
data/RDOC_MAIN.rdoc CHANGED
@@ -1,48 +1,55 @@
1
- == Welcome to \Rails
1
+ = Welcome to \Rails
2
+
3
+ == What's \Rails
2
4
 
3
5
  \Rails is a web-application framework that includes everything needed to
4
6
  create database-backed web applications according to the
5
- {Model-View-Controller (MVC)}[http://en.wikipedia.org/wiki/Model-view-controller]
7
+ {Model-View-Controller (MVC)}[https://en.wikipedia.org/wiki/Model-view-controller]
6
8
  pattern.
7
9
 
8
10
  Understanding the MVC pattern is key to understanding \Rails. MVC divides your
9
- application into three layers, each with a specific responsibility.
11
+ application into three layers: Model, View, and Controller, each with a specific responsibility.
12
+
13
+ == Model layer
10
14
 
11
- The <em>Model layer</em> represents your domain model (such as Account, Product,
12
- Person, Post, etc.) and encapsulates the business logic that is specific to
15
+ The <em><b>Model layer</b></em> represents the domain model (such as Account, Product,
16
+ Person, Post, etc.) and encapsulates the business logic specific to
13
17
  your application. In \Rails, database-backed model classes are derived from
14
- ActiveRecord::Base. Active Record allows you to present the data from
18
+ <tt>ActiveRecord::Base</tt>. {Active Record}[link:files/activerecord/README_rdoc.html] allows you to present the data from
15
19
  database rows as objects and embellish these data objects with business logic
16
- methods. You can read more about Active Record in its {README}[link:files/activerecord/README_rdoc.html].
17
- Although most \Rails models are backed by a database, models can also be ordinary
20
+ methods. Although most \Rails models are backed by a database, models can also be ordinary
18
21
  Ruby classes, or Ruby classes that implement a set of interfaces as provided by
19
- the Active Model module. You can read more about Active Model in its {README}[link:files/activemodel/README_rdoc.html].
22
+ the {Active Model}[link:files/activemodel/README_rdoc.html] module.
20
23
 
21
- The <em>Controller layer</em> is responsible for handling incoming HTTP requests and
24
+ == Controller layer
25
+
26
+ The <em><b>Controller layer</b></em> is responsible for handling incoming HTTP requests and
22
27
  providing a suitable response. Usually this means returning \HTML, but \Rails controllers
23
28
  can also generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and
24
29
  manipulate models, and render view templates in order to generate the appropriate HTTP response.
25
30
  In \Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and
26
- controller classes are derived from ActionController::Base. Action Dispatch and Action Controller
27
- are bundled together in Action Pack. You can read more about Action Pack in its
28
- {README}[link:files/actionpack/README_rdoc.html].
31
+ controller classes are derived from <tt>ActionController::Base</tt>. Action Dispatch and Action Controller
32
+ are bundled together in {Action Pack}[link:files/actionpack/README_rdoc.html].
33
+
34
+ == View layer
29
35
 
30
- The <em>View layer</em> is composed of "templates" that are responsible for providing
36
+ The <em><b>View layer</b></em> is composed of "templates" that are responsible for providing
31
37
  appropriate representations of your application's resources. Templates can
32
38
  come in a variety of formats, but most view templates are \HTML with embedded
33
39
  Ruby code (ERB files). Views are typically rendered to generate a controller response,
34
- or to generate the body of an email. In \Rails, View generation is handled by Action View.
35
- You can read more about Action View in its {README}[link:files/actionview/README_rdoc.html].
36
-
37
- Active Record, Active Model, Action Pack, and Action View can each be used independently outside \Rails.
38
- In addition to that, \Rails also comes with Action Mailer ({README}[link:files/actionmailer/README_rdoc.html]), a library
39
- to generate and send emails; Active Job ({README}[link:files/activejob/README_md.html]), a
40
- framework for declaring jobs and making them run on a variety of queueing
41
- backends; Action Cable ({README}[link:files/actioncable/README_md.html]), a framework to
42
- integrate WebSockets with a \Rails application;
43
- Active Storage ({README}[link:files/activestorage/README_md.html]), a library to attach cloud
44
- and local files to \Rails applications;
45
- and Active Support ({README}[link:files/activesupport/README_rdoc.html]), a collection
40
+ or to generate the body of an email. In \Rails, View generation is handled by {Action View}[link:files/actionview/README_rdoc.html].
41
+
42
+ == Frameworks and libraries
43
+
44
+ {Active Record}[link:files/activerecord/README_rdoc.html], {Active Model}[link:files/activemodel/README_rdoc.html],
45
+ {Action Pack}[link:files/actionpack/README_rdoc.html], and {Action View}[link:files/actionview/README_rdoc.html] can each be used independently outside \Rails.
46
+ In addition to that, \Rails also comes with {Action Mailer}[link:files/actionmailer/README_rdoc.html], a library
47
+ to generate and send emails; {Action Mailbox}[link:files/actionmailbox/README_md.html], a library to receive emails within a Rails application;
48
+ {Active Job}[link:files/activejob/README_md.html], a framework for declaring jobs and making them run on a variety of queueing
49
+ backends; {Action Cable}[link:files/actioncable/README_md.html], a framework to
50
+ integrate WebSockets with a \Rails application; {Active Storage}[link:files/activestorage/README_md.html],
51
+ a library to attach cloud and local files to \Rails applications; {Action Text}[link:files/actiontext/README_md.html], a library to handle rich text content;
52
+ and {Active Support}[link:files/activesupport/README_rdoc.html], a collection
46
53
  of utility classes and standard library extensions that are useful for \Rails,
47
54
  and may also be used independently outside \Rails.
48
55
 
@@ -61,7 +68,7 @@ and may also be used independently outside \Rails.
61
68
  3. Change directory to +myapp+ and start the web server:
62
69
 
63
70
  $ cd myapp
64
- $ rails server
71
+ $ bin/rails server
65
72
 
66
73
  Run with <tt>--help</tt> or <tt>-h</tt> for options.
67
74
 
@@ -70,18 +77,17 @@ and may also be used independently outside \Rails.
70
77
  5. Follow the guidelines to start developing your application. You may find the following resources handy:
71
78
 
72
79
  * The \README file created within your application.
73
- * {Getting Started with \Rails}[http://guides.rubyonrails.org/getting_started.html].
74
- * {Ruby on \Rails Guides}[http://guides.rubyonrails.org].
75
- * {The API Documentation}[http://api.rubyonrails.org].
76
- * {Ruby on \Rails Tutorial}[https://www.railstutorial.org/book].
80
+ * {Getting Started with \Rails}[https://guides.rubyonrails.org/getting_started.html].
81
+ * {Ruby on \Rails Guides}[https://guides.rubyonrails.org].
82
+ * {The API Documentation}[https://api.rubyonrails.org].
77
83
 
78
84
  == Contributing
79
85
 
80
86
  We encourage you to contribute to Ruby on \Rails! Please check out the
81
- {Contributing to Ruby on \Rails guide}[http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html] for guidelines about how to proceed. {Join us!}[http://contributors.rubyonrails.org]
87
+ {Contributing to Ruby on \Rails guide}[https://guides.rubyonrails.org/contributing_to_ruby_on_rails.html] for guidelines about how to proceed. {Join us!}[http://contributors.rubyonrails.org]
82
88
 
83
89
  Trying to report a possible security vulnerability in \Rails? Please
84
- check out our {security policy}[http://rubyonrails.org/security/] for
90
+ check out our {security policy}[https://rubyonrails.org/security/] for
85
91
  guidelines about how to proceed.
86
92
 
87
93
  Everyone interacting in \Rails and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow the \Rails {code of conduct}[http://rubyonrails.org/conduct/].
data/README.rdoc CHANGED
@@ -17,7 +17,7 @@ The latest version of Railties can be installed with RubyGems:
17
17
 
18
18
  Source code can be downloaded as part of the Rails project on GitHub
19
19
 
20
- * https://github.com/rails/rails/tree/5-2-stable/railties
20
+ * https://github.com/rails/rails/tree/master/railties
21
21
 
22
22
  == License
23
23
 
@@ -29,7 +29,7 @@ Railties is released under the MIT license:
29
29
 
30
30
  API documentation is at
31
31
 
32
- * http://api.rubyonrails.org
32
+ * https://api.rubyonrails.org
33
33
 
34
34
  Bug reports can be filed for the Ruby on Rails project here:
35
35
 
@@ -37,4 +37,4 @@ Bug reports can be filed for the Ruby on Rails project here:
37
37
 
38
38
  Feature requests should be discussed on the rails-core mailing list here:
39
39
 
40
- * https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-core
40
+ * https://discuss.rubyonrails.org/c/rubyonrails-core