railties 6.1.5 → 7.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +93 -407
  3. data/MIT-LICENSE +1 -1
  4. data/RDOC_MAIN.rdoc +16 -16
  5. data/README.rdoc +0 -1
  6. data/lib/rails/app_updater.rb +2 -4
  7. data/lib/rails/application/bootstrap.rb +17 -5
  8. data/lib/rails/application/configuration.rb +52 -31
  9. data/lib/rails/application/default_middleware_stack.rb +6 -3
  10. data/lib/rails/application/finisher.rb +43 -85
  11. data/lib/rails/application/routes_reloader.rb +8 -0
  12. data/lib/rails/application.rb +24 -50
  13. data/lib/rails/application_controller.rb +2 -2
  14. data/lib/rails/autoloaders/inflector.rb +21 -0
  15. data/lib/rails/autoloaders.rb +12 -16
  16. data/lib/rails/code_statistics.rb +2 -2
  17. data/lib/rails/code_statistics_calculator.rb +10 -1
  18. data/lib/rails/command/base.rb +26 -12
  19. data/lib/rails/command/behavior.rb +1 -1
  20. data/lib/rails/command/environment_argument.rb +1 -1
  21. data/lib/rails/command.rb +8 -5
  22. data/lib/rails/commands/credentials/USAGE +4 -2
  23. data/lib/rails/commands/credentials/credentials_command/diffing.rb +26 -16
  24. data/lib/rails/commands/credentials/credentials_command.rb +6 -2
  25. data/lib/rails/commands/dbconsole/dbconsole_command.rb +16 -15
  26. data/lib/rails/commands/help/USAGE +3 -2
  27. data/lib/rails/commands/runner/runner_command.rb +3 -2
  28. data/lib/rails/commands/server/server_command.rb +2 -5
  29. data/lib/rails/configuration.rb +18 -23
  30. data/lib/rails/engine/configuration.rb +2 -2
  31. data/lib/rails/engine.rb +23 -27
  32. data/lib/rails/gem_version.rb +4 -4
  33. data/lib/rails/generators/actions/create_migration.rb +2 -4
  34. data/lib/rails/generators/actions.rb +35 -13
  35. data/lib/rails/generators/app_base.rb +66 -102
  36. data/lib/rails/generators/app_name.rb +1 -1
  37. data/lib/rails/generators/base.rb +9 -13
  38. data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +2 -0
  39. data/lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt +8 -4
  40. data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +5 -27
  41. data/lib/rails/generators/erb/scaffold/templates/new.html.erb.tt +7 -3
  42. data/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt +20 -0
  43. data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +7 -16
  44. data/lib/rails/generators/erb.rb +1 -1
  45. data/lib/rails/generators/generated_attribute.rb +40 -4
  46. data/lib/rails/generators/migration.rb +2 -6
  47. data/lib/rails/generators/model_helpers.rb +1 -1
  48. data/lib/rails/generators/named_base.rb +1 -1
  49. data/lib/rails/generators/rails/app/app_generator.rb +44 -88
  50. data/lib/rails/generators/rails/app/templates/Gemfile.tt +41 -52
  51. data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css.tt +2 -2
  52. data/lib/rails/generators/rails/app/templates/app/mailers/application_mailer.rb.tt +2 -2
  53. data/lib/rails/generators/rails/app/templates/app/models/application_record.rb.tt +1 -1
  54. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +3 -10
  55. data/lib/rails/generators/rails/app/templates/bin/rails.tt +1 -4
  56. data/lib/rails/generators/rails/app/templates/bin/rake.tt +0 -3
  57. data/lib/rails/generators/rails/app/templates/bin/setup.tt +9 -14
  58. data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +1 -1
  59. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +2 -2
  60. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +3 -3
  61. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +3 -3
  62. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +2 -2
  63. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +3 -3
  64. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +2 -2
  65. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +3 -3
  66. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +1 -1
  67. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +5 -5
  68. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +2 -11
  69. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +9 -15
  70. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +2 -7
  71. data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +1 -5
  72. data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +0 -5
  73. data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +2 -2
  74. data/lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt +4 -4
  75. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt +85 -0
  76. data/lib/rails/generators/rails/app/templates/config/locales/en.yml +3 -3
  77. data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +1 -1
  78. data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +3 -0
  79. data/lib/rails/generators/rails/app/templates/config/storage.yml.tt +5 -5
  80. data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +2 -2
  81. data/lib/rails/generators/rails/app/templates/gitattributes.tt +0 -5
  82. data/lib/rails/generators/rails/app/templates/gitignore.tt +0 -1
  83. data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +1 -1
  84. data/lib/rails/generators/rails/controller/controller_generator.rb +1 -2
  85. data/lib/rails/generators/rails/controller/templates/controller.rb.tt +0 -4
  86. data/lib/rails/generators/rails/db/system/change/change_generator.rb +1 -1
  87. data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -1
  88. data/lib/rails/generators/rails/plugin/plugin_generator.rb +40 -15
  89. data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +4 -2
  90. data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +9 -9
  91. data/lib/rails/generators/rails/plugin/templates/README.md.tt +1 -1
  92. data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +2 -2
  93. data/lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt +1 -1
  94. data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +0 -3
  95. data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +4 -4
  96. data/lib/rails/generators/rails/plugin/templates/gitignore.tt +0 -5
  97. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +2 -2
  98. data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/version.rb.tt +1 -1
  99. data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +2 -2
  100. data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +3 -3
  101. data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +0 -19
  102. data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +1 -5
  103. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +6 -10
  104. data/lib/rails/generators/resource_helpers.rb +2 -2
  105. data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +1 -1
  106. data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +2 -2
  107. data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +3 -3
  108. data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +5 -5
  109. data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +2 -2
  110. data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +3 -3
  111. data/lib/rails/generators/testing/behaviour.rb +1 -2
  112. data/lib/rails/generators.rb +9 -22
  113. data/lib/rails/info.rb +1 -1
  114. data/lib/rails/info_controller.rb +1 -3
  115. data/lib/rails/initializable.rb +1 -1
  116. data/lib/rails/mailers_controller.rb +2 -4
  117. data/lib/rails/rack/logger.rb +0 -1
  118. data/lib/rails/railtie/configuration.rb +1 -2
  119. data/lib/rails/railtie.rb +9 -9
  120. data/lib/rails/ruby_version_check.rb +3 -3
  121. data/lib/rails/tasks/framework.rake +2 -8
  122. data/lib/rails/tasks/statistics.rake +3 -1
  123. data/lib/rails/tasks/tmp.rake +8 -1
  124. data/lib/rails/tasks/yarn.rake +5 -1
  125. data/lib/rails/tasks/zeitwerk.rake +2 -10
  126. data/lib/rails/templates/layouts/application.html.erb +15 -0
  127. data/lib/rails/templates/rails/mailers/email.html.erb +12 -10
  128. data/lib/rails/templates/rails/welcome/index.html.erb +3 -0
  129. data/lib/rails/test_unit/railtie.rb +0 -4
  130. data/lib/rails/test_unit/runner.rb +7 -5
  131. data/lib/rails/test_unit/testing.rake +4 -9
  132. data/lib/rails.rb +1 -0
  133. metadata +34 -36
  134. data/lib/rails/command/spellchecker.rb +0 -57
  135. data/lib/rails/generators/css/assets/assets_generator.rb +0 -15
  136. data/lib/rails/generators/css/assets/templates/stylesheet.css +0 -4
  137. data/lib/rails/generators/css/scaffold/scaffold_generator.rb +0 -18
  138. data/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js +0 -6
  139. data/lib/rails/generators/rails/app/templates/app/javascript/channels/index.js +0 -5
  140. data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +0 -23
  141. data/lib/rails/generators/rails/app/templates/bin/spring.tt +0 -13
  142. data/lib/rails/generators/rails/app/templates/bin/yarn.tt +0 -16
  143. data/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb.tt +0 -8
  144. data/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb.tt +0 -5
  145. data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +0 -67
  146. data/lib/rails/generators/rails/app/templates/config/spring.rb.tt +0 -6
  147. data/lib/rails/generators/rails/app/templates/package.json.tt +0 -11
  148. data/lib/rails/generators/rails/assets/USAGE +0 -16
  149. data/lib/rails/generators/rails/assets/assets_generator.rb +0 -26
  150. data/lib/rails/generators/rails/assets/templates/stylesheet.css +0 -4
  151. data/lib/rails/generators/rails/scaffold/templates/scaffold.css +0 -80
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 690bf9e02892d529e78567352d170e04fef38c90f826ae8a553a98d52f1de53b
4
- data.tar.gz: 226880d73ba31c5f0ea7b2eaeeac45ae9dd5d4f6d74b1b56a5e5425a44f5ebec
3
+ metadata.gz: 809add07149bc6a8fc6bd9e1848b4237e6a39642319d686c0e5e7c1ff005a0fe
4
+ data.tar.gz: 3676fc831492d4e660fe82b657b25630373e1176d5dfc0d6375857aa0de0d0cd
5
5
  SHA512:
6
- metadata.gz: 162a0e93a231aaaad5c2c9a3e28396345b53e3ea6bc91de50d4efb0a0f1e14524c4a45c1d5e4be68fe7f1b8bc40c296d3187e10c784a5c6a936e84438e54c1b0
7
- data.tar.gz: 60083023cb39da285050e673ab7840e524762cebef71b892524f65b61f7d164cff93349db2f39b1a52e37885714356a74a9c7966957fbea42e33751567517153
6
+ metadata.gz: 136de74c284cec25a993107e665b70f0732116b770c0ca3081b2b9f6a2366046d318d0153da438b557485aadb18ab0850c7135c20ef662154418e1690a0f8788
7
+ data.tar.gz: a6ad192510bd25f054e931fcbb7ef7fa3c34cbc90a9445d7b8ca173c9c2f58b5ffd40e33b10ddb27d7cdf5cf026ebb5e2a9cd7e6637804d291e922310fc795c8
data/CHANGELOG.md CHANGED
@@ -1,479 +1,165 @@
1
- ## Rails 6.1.5 (March 09, 2022) ##
1
+ ## Rails 7.0.0.alpha1 (September 15, 2021) ##
2
2
 
3
- * In `zeitwerk` mode, setup the `once` autoloader first, and the `main` autoloader after it.
4
- This order plays better with shared namespaces.
3
+ * New and upgraded Rails apps no longer generate `config/initializers/application_controller_renderer.rb`
4
+ or `config/initializers/cookies_serializer.rb`
5
5
 
6
- *Xavier Noria*
7
-
8
- * Handle paths with spaces when editing credentials.
6
+ The default value for `cookies_serializer` (`:json`) has been moved to `config.load_defaults("7.0")`.
7
+ The new framework defaults file sets the serializer to `:marshal`.
9
8
 
10
9
  *Alex Ghiculescu*
11
10
 
12
- * Support Psych 4 when loading secrets.
13
-
14
- *Nat Morcos*
15
-
16
-
17
- ## Rails 6.1.4.7 (March 08, 2022) ##
18
-
19
- * No changes.
20
-
21
-
22
- ## Rails 6.1.4.6 (February 11, 2022) ##
23
-
24
- * No changes.
25
-
26
-
27
- ## Rails 6.1.4.5 (February 11, 2022) ##
28
-
29
- * No changes.
30
-
31
-
32
- ## Rails 6.1.4.4 (December 15, 2021) ##
33
-
34
- * No changes.
35
-
36
-
37
- ## Rails 6.1.4.3 (December 14, 2021) ##
38
-
39
- * Allow localhost with a port by default in development
40
-
41
- [Fixes: #43864]
42
-
43
- ## Rails 6.1.4.2 (December 14, 2021) ##
44
-
45
- * No changes.
46
-
47
-
48
- ## Rails 6.1.4.1 (August 19, 2021) ##
49
-
50
- * No changes.
51
-
52
-
53
- ## Rails 6.1.4 (June 24, 2021) ##
54
-
55
- * Fix compatibility with `psych >= 4`.
56
-
57
- Starting in Psych 4.0.0 `YAML.load` behaves like `YAML.safe_load`. To preserve compatibility
58
- `Rails.application.config_for` now uses `YAML.unsafe_load` if available.
59
-
60
- *Jean Boussier*
61
-
62
- * Ensure `Rails.application.config_for` always cast hashes to `ActiveSupport::OrderedOptions`.
63
-
64
- *Jean Boussier*
65
-
66
- * Fix create migration generator with `--pretend` option.
67
-
68
- *euxx*
69
-
70
-
71
- ## Rails 6.1.3.2 (May 05, 2021) ##
72
-
73
- * No changes.
74
-
75
-
76
- ## Rails 6.1.3.1 (March 26, 2021) ##
77
-
78
- * No changes.
79
-
80
-
81
- ## Rails 6.1.3 (February 17, 2021) ##
82
-
83
- * No changes.
84
-
85
-
86
- ## Rails 6.1.2.1 (February 10, 2021) ##
87
-
88
- * No changes.
89
-
90
-
91
- ## Rails 6.1.2 (February 09, 2021) ##
92
-
93
- * No changes.
94
-
95
-
96
- ## Rails 6.1.1 (January 07, 2021) ##
97
-
98
- * Allow spaces in path to Yarn binstub and only run on precompile if needed.
99
-
100
- *Markus Doits*
101
-
102
- * Populate ARGV for app template.
103
-
104
- Fixes #40945.
105
-
106
- *Jonathan Hefner*
107
-
108
-
109
- ## Rails 6.1.0 (December 09, 2020) ##
110
-
111
- * Added `Railtie#server` hook called when Rails starts a server.
112
- This is useful in case your application or a library needs to run
113
- another process next to the Rails server. This is quite common in development
114
- for instance to run the Webpack or the React server.
115
-
116
- It can be used like this:
117
-
118
- ```ruby
119
- class MyRailtie < Rails::Railtie
120
- server do
121
- WebpackServer.run
122
- end
123
- end
124
- ```
125
-
126
- *Edouard Chin*
127
-
128
- * Remove deprecated `rake dev:cache` tasks.
129
-
130
- *Rafael Mendonça França*
131
-
132
- * Remove deprecated `rake routes` tasks.
133
-
134
- *Rafael Mendonça França*
135
-
136
- * Remove deprecated `rake initializers` tasks.
137
-
138
- *Rafael Mendonça França*
139
-
140
- * Remove deprecated support for using the `HOST` environment variable to specify the server IP.
141
-
142
- *Rafael Mendonça França*
143
-
144
- * Remove deprecated `server` argument from the rails server command.
145
-
146
- *Rafael Mendonça França*
147
-
148
- * Remove deprecated `SOURCE_ANNOTATION_DIRECTORIES` environment variable support from `rails notes`.
149
-
150
- *Rafael Mendonça França*
151
-
152
- * Remove deprecated `connection` option in the `rails dbconsole` command.
153
-
154
- *Rafael Mendonça França*
155
-
156
- * Remove depreated `rake notes` tasks.
157
-
158
- *Rafael Mendonça França*
159
-
160
- * Return a 405 Method Not Allowed response when a request uses an unknown HTTP method.
161
-
162
- Fixes #38998.
163
-
164
- *Loren Norman*
165
-
166
- * Make railsrc file location xdg-specification compliant
167
-
168
- `rails new` will now look for the default `railsrc` file at
169
- `$XDG_CONFIG_HOME/rails/railsrc` (or `~/.config/rails/railsrc` if
170
- `XDG_CONFIG_HOME` is not set). If this file does not exist, `rails new`
171
- will fall back to `~/.railsrc`.
172
-
173
- The fallback behaviour means this does not cause any breaking changes.
174
-
175
- *Nick Wolf*
176
-
177
- * Change the default logging level from :debug to :info to avoid inadvertent exposure of personally
178
- identifiable information (PII) in production environments.
179
-
180
- *Eric M. Payne*
181
-
182
- * Automatically generate abstract class when using multiple databases.
183
-
184
- 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.
185
-
186
- Usage:
187
-
188
- ```bash
189
- $ bin/rails generate scaffold Pet name:string --database=animals
190
- ```
191
-
192
- Will create an abstract class for the animals connection.
193
-
194
- ```ruby
195
- class AnimalsRecord < ApplicationRecord
196
- self.abstract_class = true
197
-
198
- connects_to database: { writing: :animals }
199
- end
200
- ```
201
-
202
- And generate a `Pet` model that inherits from the new `AnimalsRecord`:
203
-
204
- ```ruby
205
- class Pet < AnimalsRecord
206
- end
207
- ```
208
-
209
- 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.
210
-
211
- ```bash
212
- $ bin/rails generate scaffold Pet name:string --database=animals --parent=SecondaryBase
213
- ```
214
-
215
- This will ensure the model inherits from the `SecondaryBase` parent instead of `AnimalsRecord`
216
-
217
- ```ruby
218
- class Pet < SecondaryBase
219
- end
220
- ```
221
-
222
- *Eileen M. Uchitelle*, *John Crepezzi*
223
-
224
- * Accept params from url to prepopulate the Inbound Emails form in Rails conductor.
225
-
226
- *Chris Oliver*
227
-
228
- * Create a new rails app using a minimal stack.
229
-
230
- `rails new cool_app --minimal`
231
-
232
- All the following are excluded from your minimal stack:
233
-
234
- - action_cable
235
- - action_mailbox
236
- - action_mailer
237
- - action_text
238
- - active_job
239
- - active_storage
240
- - bootsnap
241
- - jbuilder
242
- - spring
243
- - system_tests
244
- - turbolinks
245
- - webpack
246
-
247
- *Haroon Ahmed*, *DHH*
248
-
249
- * Add default ENV variable option with BACKTRACE to turn off backtrace cleaning when debugging framework code in the
250
- generated config/initializers/backtrace_silencers.rb.
251
-
252
- `BACKTRACE=1 ./bin/rails runner "MyClass.perform"`
253
-
254
- *DHH*
255
-
256
- * The autoloading guide for Zeitwerk mode documents how to autoload classes
257
- during application boot in a safe way.
258
-
259
- *Haroon Ahmed*, *Xavier Noria*
260
-
261
- * The `classic` autoloader starts its deprecation cycle.
262
-
263
- 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.
11
+ * New applications get a dependency on the new `debug` gem, replacing `byebug`.
264
12
 
265
13
  *Xavier Noria*
266
14
 
267
- * Adds `rails test:all` for running all tests in the test directory.
268
-
269
- This runs all test files in the test directory, including system tests.
270
-
271
- *Niklas Häusele*
272
-
273
- * Add `config.generators.after_generate` for processing to generated files.
274
-
275
- Register a callback that will get called right after generators has finished.
276
-
277
- *Yuji Yaginuma*
278
-
279
- * Make test file patterns configurable via Environment variables
280
-
281
- This makes test file patterns configurable via two environment variables:
282
- `DEFAULT_TEST`, to configure files to test, and `DEFAULT_TEST_EXCLUDE`,
283
- to configure files to exclude from testing.
284
-
285
- These values were hardcoded before, which made it difficult to add
286
- new categories of tests that should not be executed by default (e.g:
287
- smoke tests).
288
-
289
- *Jorge Manrubia*
15
+ * Add SSL support for postgresql in `bin/rails dbconsole`.
290
16
 
291
- * No longer include `rake rdoc` task when generating plugins.
17
+ Fixes #43114.
292
18
 
293
- To generate docs, use the `rdoc lib` command instead.
19
+ *Michael Bayucot*
294
20
 
295
- *Jonathan Hefner*
21
+ * Add support for comments above gem declaration in Rails application templates, e.g. `gem("nokogiri", comment: "For XML")`.
296
22
 
297
- * Allow relative paths with trailing slashes to be passed to `rails test`.
23
+ *Linas Juškevičius*
298
24
 
299
- *Eugene Kenny*
25
+ * The setter `config.autoloader=` has been deleted. `zeitwerk` is the only
26
+ available autoloading mode.
300
27
 
301
- * Add `rack-mini-profiler` gem to the default `Gemfile`.
302
-
303
- `rack-mini-profiler` displays performance information such as SQL time and flame graphs.
304
- It's enabled by default in development environment, but can be enabled in production as well.
305
- See the gem [README](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md) for information on how to enable it in production.
306
-
307
- *Osama Sayegh*
308
-
309
- * `rails stats` will now count TypeScript files toward JavaScript stats.
310
-
311
- *Joshua Cody*
312
-
313
- * Run `git init` when generating plugins.
28
+ *Xavier Noria*
314
29
 
315
- Opt out with `--skip-git`.
30
+ * `config.autoload_once_paths` can be configured in the body of the
31
+ application class defined in `config/application.rb` or in the configuration
32
+ for environments in `config/environments/*`.
316
33
 
317
- *OKURA Masafumi*
34
+ Similarly, engines can configure that collection in the class body of the
35
+ engine class or in the configuration for environments.
318
36
 
319
- * Add benchmark generator.
37
+ After that, the collection is frozen, and you can autoload from those paths.
38
+ They are managed by the `Rails.autoloaders.once` autoloader, which does not
39
+ reload, only autoloads/eager loads.
320
40
 
321
- Introduce benchmark generator to benchmark Rails applications.
41
+ *Xavier Noria*
322
42
 
323
- `rails generate benchmark opt_compare`
43
+ * During initialization, you cannot autoload reloadable classes or modules
44
+ like application models, unless they are wrapped in a `to_prepare` block.
45
+ For example, from `config/initializers/*`, or in application, engines, or
46
+ railties initializers.
324
47
 
325
- This creates a benchmark file that uses [`benchmark-ips`](https://github.com/evanphx/benchmark-ips).
326
- By default, two code blocks can be benchmarked using the `before` and `after` reports.
48
+ Please check the [autoloading
49
+ guide](https://guides.rubyonrails.org/v7.0/autoloading_and_reloading_constants.html#autoloading-when-the-application-boots)
50
+ for details.
327
51
 
328
- You can run the generated benchmark file using:
329
- `ruby script/benchmarks/opt_compare.rb`
52
+ *Xavier Noria*
330
53
 
331
- *Kevin Jalbert*, *Gannon McGibbon*
54
+ * While they are allowed to have elements in common, it is no longer required
55
+ that `config.autoload_once_paths` is a subset of `config.autoload_paths`.
56
+ The former are managed by the `once` autoloader. The `main` autoloader
57
+ manages the latter minus the former.
332
58
 
333
- * Cache compiled view templates when running tests by default.
59
+ *Xavier Noria*
334
60
 
335
- When generating a new app without `--skip-spring`, caching classes is
336
- disabled in `environments/test.rb`. This implicitly disables caching
337
- view templates too. This change will enable view template caching by
338
- adding this to the generated `environments/test.rb`:
61
+ * Show Rake task description if command is run with `-h`.
339
62
 
340
- ```ruby
341
- config.action_view.cache_template_loading = true
342
- ```
63
+ Adding `-h` (or `--help`) to a Rails command that's a Rake task now outputs
64
+ the task description instead of the general Rake help.
343
65
 
344
- *Jorge Manrubia*
66
+ *Petrik de Heus*
345
67
 
346
- * Introduce middleware move operations.
68
+ * Add missing `plugin new` command to help.
347
69
 
348
- With this change, you no longer need to delete and reinsert a middleware to
349
- move it from one place to another in the stack:
70
+ *Petrik de Heus
350
71
 
351
- ```ruby
352
- config.middleware.move_before ActionDispatch::Flash, Magical::Unicorns
353
- ```
72
+ * Fix `config_for` error when there's only a shared root array.
354
73
 
355
- This will move the `Magical::Unicorns` middleware before
356
- `ActionDispatch::Flash`. You can also move it after with:
74
+ *Loïc Delmaire*
357
75
 
358
- ```ruby
359
- config.middleware.move_after ActionDispatch::Flash, Magical::Unicorns
360
- ```
76
+ * Raise an error in generators if an index type is invalid.
361
77
 
362
- *Genadi Samokovarov*
78
+ *Petrik de Heus*
363
79
 
364
- * Generators that inherit from NamedBase respect `--force` option.
80
+ * `package.json` now uses a strict version constraint for Rails JavaScript packages on new Rails apps.
365
81
 
366
- *Josh Brody*
82
+ *Zachary Scott*, *Alex Ghiculescu*
367
83
 
368
- * Allow configuration of eager_load behaviour for rake environment:
84
+ * Modified scaffold generator template so that running
85
+ `rails g scaffold Author` no longer generates tests called "creating
86
+ a Author", "updating a Author", and "destroying a Author".
369
87
 
370
- config.rake_eager_load
88
+ Fixes #40744.
371
89
 
372
- Defaults to `false` as per previous behaviour.
90
+ *Michael Duchemin*
373
91
 
374
- *Thierry Joyal*
92
+ * Raise an error in generators if a field type is invalid.
375
93
 
376
- * Ensure Rails migration generator respects system-wide primary key config.
94
+ *Petrik de Heus*
377
95
 
378
- When rails is configured to use a specific primary key type:
96
+ * `bin/rails tmp:clear` deletes also files and directories in `tmp/storage`.
379
97
 
380
- ```ruby
381
- config.generators do |g|
382
- g.orm :active_record, primary_key_type: :uuid
383
- end
384
- ```
98
+ *George Claghorn*
385
99
 
386
- Previously:
100
+ * Fix compatibility with `psych >= 4`.
387
101
 
388
- ```bash
389
- $ bin/rails g migration add_location_to_users location:references
390
- ```
102
+ Starting in Psych 4.0.0 `YAML.load` behaves like `YAML.safe_load`. To preserve compatibility
103
+ `Rails.application.config_for` now uses `YAML.unsafe_load` if available.
391
104
 
392
- The references line in the migration would not have `type: :uuid`.
393
- This change causes the type to be applied appropriately.
105
+ *Jean Boussier*
394
106
 
395
- *Louis-Michel Couture*, *Dermot Haughey*
107
+ * Allow loading nested locales in engines.
396
108
 
397
- * Deprecate `Rails::DBConsole#config`.
109
+ *Gannon McGibbon*
398
110
 
399
- `Rails::DBConsole#config` is deprecated without replacement. Use `Rails::DBConsole.db_config.configuration_hash` instead.
111
+ * Ensure `Rails.application.config_for` always cast hashes to `ActiveSupport::OrderedOptions`.
400
112
 
401
- *Eileen M. Uchitelle*, *John Crepezzi*
113
+ *Jean Boussier*
402
114
 
403
- * `Rails.application.config_for` merges shared configuration deeply.
115
+ * Remove `Rack::Runtime` from the default middleware stack and deprecate
116
+ referencing it in middleware operations without adding it back.
404
117
 
405
- ```yaml
406
- # config/example.yml
407
- shared:
408
- foo:
409
- bar:
410
- baz: 1
411
- development:
412
- foo:
413
- bar:
414
- qux: 2
415
- ```
118
+ *Hartley McGuire*
416
119
 
417
- ```ruby
418
- # Previously
419
- Rails.application.config_for(:example)[:foo][:bar] #=> { qux: 2 }
120
+ * Allow adding additional authorized hosts in development via `ENV['RAILS_DEVELOPMENT_HOSTS']`.
420
121
 
421
- # Now
422
- Rails.application.config_for(:example)[:foo][:bar] #=> { baz: 1, qux: 2 }
423
- ```
122
+ *Josh Abernathy*, *Debbie Milburn*
424
123
 
425
- *Yuhei Kiriyama*
124
+ * Add app concern and test keepfiles to generated engine plugins.
426
125
 
427
- * Remove access to values in nested hashes returned by `Rails.application.config_for` via String keys.
126
+ *Gannon McGibbon*
428
127
 
429
- ```yaml
430
- # config/example.yml
431
- development:
432
- options:
433
- key: value
434
- ```
128
+ * Stop generating a license for in-app plugins.
435
129
 
436
- ```ruby
437
- Rails.application.config_for(:example).options
438
- ```
130
+ *Gannon McGibbon*
439
131
 
440
- 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.
132
+ * `rails app:update` no longer prompts you to overwrite files that are generally modified in the
133
+ course of developing a Rails app. See [#41083](https://github.com/rails/rails/pull/41083) for
134
+ the full list of changes.
441
135
 
442
- *Étienne Barrié*
136
+ *Alex Ghiculescu*
443
137
 
444
- * Configuration files for environments (`config/environments/*.rb`) are
445
- now able to modify `autoload_paths`, `autoload_once_paths`, and
446
- `eager_load_paths`.
138
+ * Change default branch for new Rails projects and plugins to `main`.
447
139
 
448
- 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.
140
+ *Prateek Choudhary*
449
141
 
450
- Ways to use application code in these files:
142
+ * The new method `Rails.benchmark` gives you a quick way to measure and log the execution time taken by a block:
451
143
 
452
- * 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.
144
+ def test_expensive_stuff
145
+ Rails.benchmark("test_expensive_stuff") { ... }
146
+ end
453
147
 
454
- ```ruby
455
- # In config/application.rb, for example.
456
- require "#{Rails.root}/lib/my_app/config"
148
+ This functionality was available in some contexts only before.
457
149
 
458
- # In config/environments/development.rb, for example.
459
- config.foo = MyApp::Config.foo
460
- ```
150
+ *Simon Perepelitsa*
461
151
 
462
- * If the class has to be reloadable, then wrap the configuration code in a `to_prepare` block:
152
+ * Applications generated with `--skip-sprockets` no longer get `app/assets/config/manifest.js` and `app/assets/stylesheets/application.css`.
463
153
 
464
- ```ruby
465
- config.to_prepare do
466
- config.foo = MyModel.foo
467
- end
468
- ```
154
+ *Cindy Gao*
469
155
 
470
- 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.
156
+ * Add support for stylesheets and ERB views to `rails stats`.
471
157
 
472
- *Allen Hsu* & *Xavier Noria*
158
+ *Joel Hawksley*
473
159
 
474
- * Support using environment variable to set pidfile.
160
+ * Allow appended root routes to take precedence over internal welcome controller.
475
161
 
476
- *Ben Thorner*
162
+ *Gannon McGibbon*
477
163
 
478
164
 
479
- Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/railties/CHANGELOG.md) for previous changes.
165
+ Please check [6-1-stable](https://github.com/rails/rails/blob/6-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) 2004-2021 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
@@ -15,21 +15,21 @@ application into three layers: Model, View, and Controller, each with a specific
15
15
  The <em><b>Model layer</b></em> represents the domain model (such as Account, Product,
16
16
  Person, Post, etc.) and encapsulates the business logic specific to
17
17
  your application. In \Rails, database-backed model classes are derived from
18
- <tt>ActiveRecord::Base</tt>. {Active Record}[link:files/activerecord/README_rdoc.html] 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
19
19
  database rows as objects and embellish these data objects with business logic
20
20
  methods. Although most \Rails models are backed by a database, models can also be ordinary
21
21
  Ruby classes, or Ruby classes that implement a set of interfaces as provided by
22
- the {Active Model}[link:files/activemodel/README_rdoc.html] module.
22
+ the {Active Model}[link:/files/activemodel/README_rdoc.html] module.
23
23
 
24
24
  == Controller layer
25
25
 
26
26
  The <em><b>Controller layer</b></em> is responsible for handling incoming HTTP requests and
27
- providing a suitable response. Usually this means returning \HTML, but \Rails controllers
27
+ providing a suitable response. Usually, this means returning \HTML, but \Rails controllers
28
28
  can also generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and
29
- manipulate models, and render view templates in order to generate the appropriate HTTP response.
29
+ manipulate models and render view templates in order to generate the appropriate HTTP response.
30
30
  In \Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and
31
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].
32
+ are bundled together in {Action Pack}[link:/files/actionpack/README_rdoc.html].
33
33
 
34
34
  == View layer
35
35
 
@@ -37,19 +37,19 @@ The <em><b>View layer</b></em> is composed of "templates" that are responsible f
37
37
  appropriate representations of your application's resources. Templates can
38
38
  come in a variety of formats, but most view templates are \HTML with embedded
39
39
  Ruby code (ERB files). Views are typically rendered to generate a controller response,
40
- or to generate the body of an email. In \Rails, View generation is handled by {Action View}[link:files/actionview/README_rdoc.html].
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
41
 
42
42
  == Frameworks and libraries
43
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
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
53
53
  of utility classes and standard library extensions that are useful for \Rails,
54
54
  and may also be used independently outside \Rails.
55
55
 
@@ -72,7 +72,7 @@ and may also be used independently outside \Rails.
72
72
 
73
73
  Run with <tt>--help</tt> or <tt>-h</tt> for options.
74
74
 
75
- 4. Go to <tt>http://localhost:3000</tt> and you'll see: "Yay! You’re on \Rails!"
75
+ 4. Go to <tt>http://localhost:3000</tt>, and you'll see: "Yay! You’re on \Rails!"
76
76
 
77
77
  5. Follow the guidelines to start developing your application. You may find the following resources handy:
78
78
 
data/README.rdoc CHANGED
@@ -8,7 +8,6 @@ Railties is responsible for gluing all frameworks together. Overall, it:
8
8
 
9
9
  * and provides the Rails generators core.
10
10
 
11
-
12
11
  == Download
13
12
 
14
13
  The latest version of Railties can be installed with RubyGems: