railties 6.1.4.1 → 7.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +94 -361
- data/MIT-LICENSE +1 -1
- data/RDOC_MAIN.rdoc +16 -16
- data/README.rdoc +0 -1
- data/lib/rails/app_updater.rb +2 -4
- data/lib/rails/application/bootstrap.rb +17 -5
- data/lib/rails/application/configuration.rb +51 -26
- data/lib/rails/application/default_middleware_stack.rb +6 -3
- data/lib/rails/application/finisher.rb +43 -85
- data/lib/rails/application/routes_reloader.rb +8 -0
- data/lib/rails/application.rb +24 -50
- data/lib/rails/application_controller.rb +2 -2
- data/lib/rails/autoloaders/inflector.rb +21 -0
- data/lib/rails/autoloaders.rb +12 -16
- data/lib/rails/code_statistics.rb +2 -2
- data/lib/rails/code_statistics_calculator.rb +10 -1
- data/lib/rails/command/base.rb +26 -12
- data/lib/rails/command/behavior.rb +1 -1
- data/lib/rails/command/environment_argument.rb +1 -1
- data/lib/rails/command.rb +8 -5
- data/lib/rails/commands/credentials/USAGE +4 -2
- data/lib/rails/commands/credentials/credentials_command/diffing.rb +26 -16
- data/lib/rails/commands/credentials/credentials_command.rb +8 -3
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +10 -6
- data/lib/rails/commands/help/USAGE +3 -2
- data/lib/rails/commands/runner/runner_command.rb +3 -2
- data/lib/rails/commands/server/server_command.rb +2 -5
- data/lib/rails/configuration.rb +18 -23
- data/lib/rails/engine/configuration.rb +2 -2
- data/lib/rails/engine.rb +23 -27
- data/lib/rails/gem_version.rb +4 -4
- data/lib/rails/generators/actions/create_migration.rb +2 -4
- data/lib/rails/generators/actions.rb +35 -13
- data/lib/rails/generators/app_base.rb +66 -102
- data/lib/rails/generators/app_name.rb +1 -1
- data/lib/rails/generators/base.rb +9 -13
- data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +2 -0
- data/lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt +8 -4
- data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +5 -27
- data/lib/rails/generators/erb/scaffold/templates/new.html.erb.tt +7 -3
- data/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt +20 -0
- data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +7 -16
- data/lib/rails/generators/erb.rb +1 -1
- data/lib/rails/generators/generated_attribute.rb +40 -4
- data/lib/rails/generators/migration.rb +2 -6
- data/lib/rails/generators/model_helpers.rb +1 -1
- data/lib/rails/generators/named_base.rb +1 -1
- data/lib/rails/generators/rails/app/app_generator.rb +44 -88
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +41 -52
- data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css.tt +2 -2
- data/lib/rails/generators/rails/app/templates/app/mailers/application_mailer.rb.tt +2 -2
- data/lib/rails/generators/rails/app/templates/app/models/application_record.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +3 -10
- data/lib/rails/generators/rails/app/templates/bin/rails.tt +1 -4
- data/lib/rails/generators/rails/app/templates/bin/rake.tt +0 -3
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +9 -14
- data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +5 -5
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +2 -11
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +9 -15
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +2 -7
- data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +1 -5
- data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +0 -5
- data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt +4 -4
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt +85 -0
- data/lib/rails/generators/rails/app/templates/config/locales/en.yml +3 -3
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +3 -0
- data/lib/rails/generators/rails/app/templates/config/storage.yml.tt +5 -5
- data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +2 -2
- data/lib/rails/generators/rails/app/templates/gitattributes.tt +0 -5
- data/lib/rails/generators/rails/app/templates/gitignore.tt +0 -1
- data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +1 -1
- data/lib/rails/generators/rails/controller/controller_generator.rb +1 -2
- data/lib/rails/generators/rails/controller/templates/controller.rb.tt +0 -4
- data/lib/rails/generators/rails/db/system/change/change_generator.rb +1 -1
- data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +40 -15
- data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +4 -2
- data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +9 -9
- data/lib/rails/generators/rails/plugin/templates/README.md.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +2 -2
- data/lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +0 -3
- data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +4 -4
- data/lib/rails/generators/rails/plugin/templates/gitignore.tt +0 -5
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +2 -2
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/version.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +2 -2
- data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +3 -3
- data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +0 -19
- data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +1 -5
- data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +6 -10
- data/lib/rails/generators/resource_helpers.rb +2 -2
- data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +2 -2
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +3 -3
- data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +5 -5
- data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +2 -2
- data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +3 -3
- data/lib/rails/generators/testing/behaviour.rb +1 -2
- data/lib/rails/generators.rb +9 -22
- data/lib/rails/info.rb +1 -1
- data/lib/rails/info_controller.rb +1 -3
- data/lib/rails/initializable.rb +1 -1
- data/lib/rails/mailers_controller.rb +2 -4
- data/lib/rails/rack/logger.rb +0 -1
- data/lib/rails/railtie/configuration.rb +1 -2
- data/lib/rails/railtie.rb +9 -9
- data/lib/rails/ruby_version_check.rb +3 -3
- data/lib/rails/secrets.rb +4 -1
- data/lib/rails/tasks/framework.rake +2 -8
- data/lib/rails/tasks/statistics.rake +3 -1
- data/lib/rails/tasks/tmp.rake +8 -1
- data/lib/rails/tasks/yarn.rake +5 -1
- data/lib/rails/tasks/zeitwerk.rake +2 -10
- data/lib/rails/templates/layouts/application.html.erb +15 -0
- data/lib/rails/templates/rails/mailers/email.html.erb +12 -10
- data/lib/rails/templates/rails/welcome/index.html.erb +3 -0
- data/lib/rails/test_unit/railtie.rb +0 -4
- data/lib/rails/test_unit/runner.rb +7 -5
- data/lib/rails/test_unit/testing.rake +4 -9
- data/lib/rails.rb +1 -0
- metadata +35 -36
- data/lib/rails/command/spellchecker.rb +0 -57
- data/lib/rails/generators/css/assets/assets_generator.rb +0 -15
- data/lib/rails/generators/css/assets/templates/stylesheet.css +0 -4
- data/lib/rails/generators/css/scaffold/scaffold_generator.rb +0 -18
- data/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js +0 -6
- data/lib/rails/generators/rails/app/templates/app/javascript/channels/index.js +0 -5
- data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +0 -23
- data/lib/rails/generators/rails/app/templates/bin/spring.tt +0 -13
- data/lib/rails/generators/rails/app/templates/bin/yarn.tt +0 -16
- data/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb.tt +0 -8
- data/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb.tt +0 -5
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +0 -67
- data/lib/rails/generators/rails/app/templates/config/spring.rb.tt +0 -6
- data/lib/rails/generators/rails/app/templates/package.json.tt +0 -11
- data/lib/rails/generators/rails/assets/USAGE +0 -16
- data/lib/rails/generators/rails/assets/assets_generator.rb +0 -26
- data/lib/rails/generators/rails/assets/templates/stylesheet.css +0 -4
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 809add07149bc6a8fc6bd9e1848b4237e6a39642319d686c0e5e7c1ff005a0fe
|
4
|
+
data.tar.gz: 3676fc831492d4e660fe82b657b25630373e1176d5dfc0d6375857aa0de0d0cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 136de74c284cec25a993107e665b70f0732116b770c0ca3081b2b9f6a2366046d318d0153da438b557485aadb18ab0850c7135c20ef662154418e1690a0f8788
|
7
|
+
data.tar.gz: a6ad192510bd25f054e931fcbb7ef7fa3c34cbc90a9445d7b8ca173c9c2f58b5ffd40e33b10ddb27d7cdf5cf026ebb5e2a9cd7e6637804d291e922310fc795c8
|
data/CHANGELOG.md
CHANGED
@@ -1,432 +1,165 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* New and upgraded Rails apps no longer generate `config/initializers/application_controller_renderer.rb`
|
4
|
+
or `config/initializers/cookies_serializer.rb`
|
4
5
|
|
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`.
|
5
8
|
|
6
|
-
|
9
|
+
*Alex Ghiculescu*
|
7
10
|
|
8
|
-
*
|
9
|
-
|
10
|
-
Starting in Psych 4.0.0 `YAML.load` behaves like `YAML.safe_load`. To preserve compatibility
|
11
|
-
`Rails.application.config_for` now uses `YAML.unsafe_load` if available.
|
12
|
-
|
13
|
-
*Jean Boussier*
|
14
|
-
|
15
|
-
* Ensure `Rails.application.config_for` always cast hashes to `ActiveSupport::OrderedOptions`.
|
16
|
-
|
17
|
-
*Jean Boussier*
|
18
|
-
|
19
|
-
* Fix create migration generator with `--pretend` option.
|
20
|
-
|
21
|
-
*euxx*
|
22
|
-
|
23
|
-
|
24
|
-
## Rails 6.1.3.2 (May 05, 2021) ##
|
25
|
-
|
26
|
-
* No changes.
|
27
|
-
|
28
|
-
|
29
|
-
## Rails 6.1.3.1 (March 26, 2021) ##
|
30
|
-
|
31
|
-
* No changes.
|
32
|
-
|
33
|
-
|
34
|
-
## Rails 6.1.3 (February 17, 2021) ##
|
35
|
-
|
36
|
-
* No changes.
|
37
|
-
|
38
|
-
|
39
|
-
## Rails 6.1.2.1 (February 10, 2021) ##
|
40
|
-
|
41
|
-
* No changes.
|
42
|
-
|
43
|
-
|
44
|
-
## Rails 6.1.2 (February 09, 2021) ##
|
45
|
-
|
46
|
-
* No changes.
|
47
|
-
|
48
|
-
|
49
|
-
## Rails 6.1.1 (January 07, 2021) ##
|
50
|
-
|
51
|
-
* Allow spaces in path to Yarn binstub and only run on precompile if needed.
|
52
|
-
|
53
|
-
*Markus Doits*
|
54
|
-
|
55
|
-
* Populate ARGV for app template.
|
56
|
-
|
57
|
-
Fixes #40945.
|
58
|
-
|
59
|
-
*Jonathan Hefner*
|
60
|
-
|
61
|
-
|
62
|
-
## Rails 6.1.0 (December 09, 2020) ##
|
63
|
-
|
64
|
-
* Added `Railtie#server` hook called when Rails starts a server.
|
65
|
-
This is useful in case your application or a library needs to run
|
66
|
-
another process next to the Rails server. This is quite common in development
|
67
|
-
for instance to run the Webpack or the React server.
|
68
|
-
|
69
|
-
It can be used like this:
|
70
|
-
|
71
|
-
```ruby
|
72
|
-
class MyRailtie < Rails::Railtie
|
73
|
-
server do
|
74
|
-
WebpackServer.run
|
75
|
-
end
|
76
|
-
end
|
77
|
-
```
|
78
|
-
|
79
|
-
*Edouard Chin*
|
80
|
-
|
81
|
-
* Remove deprecated `rake dev:cache` tasks.
|
82
|
-
|
83
|
-
*Rafael Mendonça França*
|
84
|
-
|
85
|
-
* Remove deprecated `rake routes` tasks.
|
86
|
-
|
87
|
-
*Rafael Mendonça França*
|
88
|
-
|
89
|
-
* Remove deprecated `rake initializers` tasks.
|
90
|
-
|
91
|
-
*Rafael Mendonça França*
|
92
|
-
|
93
|
-
* Remove deprecated support for using the `HOST` environment variable to specify the server IP.
|
94
|
-
|
95
|
-
*Rafael Mendonça França*
|
96
|
-
|
97
|
-
* Remove deprecated `server` argument from the rails server command.
|
98
|
-
|
99
|
-
*Rafael Mendonça França*
|
100
|
-
|
101
|
-
* Remove deprecated `SOURCE_ANNOTATION_DIRECTORIES` environment variable support from `rails notes`.
|
102
|
-
|
103
|
-
*Rafael Mendonça França*
|
104
|
-
|
105
|
-
* Remove deprecated `connection` option in the `rails dbconsole` command.
|
106
|
-
|
107
|
-
*Rafael Mendonça França*
|
108
|
-
|
109
|
-
* Remove depreated `rake notes` tasks.
|
110
|
-
|
111
|
-
*Rafael Mendonça França*
|
112
|
-
|
113
|
-
* Return a 405 Method Not Allowed response when a request uses an unknown HTTP method.
|
114
|
-
|
115
|
-
Fixes #38998.
|
116
|
-
|
117
|
-
*Loren Norman*
|
118
|
-
|
119
|
-
* Make railsrc file location xdg-specification compliant
|
120
|
-
|
121
|
-
`rails new` will now look for the default `railsrc` file at
|
122
|
-
`$XDG_CONFIG_HOME/rails/railsrc` (or `~/.config/rails/railsrc` if
|
123
|
-
`XDG_CONFIG_HOME` is not set). If this file does not exist, `rails new`
|
124
|
-
will fall back to `~/.railsrc`.
|
125
|
-
|
126
|
-
The fallback behaviour means this does not cause any breaking changes.
|
127
|
-
|
128
|
-
*Nick Wolf*
|
129
|
-
|
130
|
-
* Change the default logging level from :debug to :info to avoid inadvertent exposure of personally
|
131
|
-
identifiable information (PII) in production environments.
|
132
|
-
|
133
|
-
*Eric M. Payne*
|
134
|
-
|
135
|
-
* Automatically generate abstract class when using multiple databases.
|
136
|
-
|
137
|
-
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.
|
138
|
-
|
139
|
-
Usage:
|
140
|
-
|
141
|
-
```bash
|
142
|
-
$ bin/rails generate scaffold Pet name:string --database=animals
|
143
|
-
```
|
144
|
-
|
145
|
-
Will create an abstract class for the animals connection.
|
146
|
-
|
147
|
-
```ruby
|
148
|
-
class AnimalsRecord < ApplicationRecord
|
149
|
-
self.abstract_class = true
|
150
|
-
|
151
|
-
connects_to database: { writing: :animals }
|
152
|
-
end
|
153
|
-
```
|
154
|
-
|
155
|
-
And generate a `Pet` model that inherits from the new `AnimalsRecord`:
|
156
|
-
|
157
|
-
```ruby
|
158
|
-
class Pet < AnimalsRecord
|
159
|
-
end
|
160
|
-
```
|
161
|
-
|
162
|
-
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.
|
163
|
-
|
164
|
-
```bash
|
165
|
-
$ bin/rails generate scaffold Pet name:string --database=animals --parent=SecondaryBase
|
166
|
-
```
|
167
|
-
|
168
|
-
This will ensure the model inherits from the `SecondaryBase` parent instead of `AnimalsRecord`
|
169
|
-
|
170
|
-
```ruby
|
171
|
-
class Pet < SecondaryBase
|
172
|
-
end
|
173
|
-
```
|
174
|
-
|
175
|
-
*Eileen M. Uchitelle*, *John Crepezzi*
|
176
|
-
|
177
|
-
* Accept params from url to prepopulate the Inbound Emails form in Rails conductor.
|
178
|
-
|
179
|
-
*Chris Oliver*
|
180
|
-
|
181
|
-
* Create a new rails app using a minimal stack.
|
182
|
-
|
183
|
-
`rails new cool_app --minimal`
|
184
|
-
|
185
|
-
All the following are excluded from your minimal stack:
|
186
|
-
|
187
|
-
- action_cable
|
188
|
-
- action_mailbox
|
189
|
-
- action_mailer
|
190
|
-
- action_text
|
191
|
-
- active_job
|
192
|
-
- active_storage
|
193
|
-
- bootsnap
|
194
|
-
- jbuilder
|
195
|
-
- spring
|
196
|
-
- system_tests
|
197
|
-
- turbolinks
|
198
|
-
- webpack
|
199
|
-
|
200
|
-
*Haroon Ahmed*, *DHH*
|
201
|
-
|
202
|
-
* Add default ENV variable option with BACKTRACE to turn off backtrace cleaning when debugging framework code in the
|
203
|
-
generated config/initializers/backtrace_silencers.rb.
|
204
|
-
|
205
|
-
`BACKTRACE=1 ./bin/rails runner "MyClass.perform"`
|
206
|
-
|
207
|
-
*DHH*
|
208
|
-
|
209
|
-
* The autoloading guide for Zeitwerk mode documents how to autoload classes
|
210
|
-
during application boot in a safe way.
|
211
|
-
|
212
|
-
*Haroon Ahmed*, *Xavier Noria*
|
213
|
-
|
214
|
-
* The `classic` autoloader starts its deprecation cycle.
|
215
|
-
|
216
|
-
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`.
|
217
12
|
|
218
13
|
*Xavier Noria*
|
219
14
|
|
220
|
-
*
|
221
|
-
|
222
|
-
This runs all test files in the test directory, including system tests.
|
223
|
-
|
224
|
-
*Niklas Häusele*
|
225
|
-
|
226
|
-
* Add `config.generators.after_generate` for processing to generated files.
|
227
|
-
|
228
|
-
Register a callback that will get called right after generators has finished.
|
229
|
-
|
230
|
-
*Yuji Yaginuma*
|
231
|
-
|
232
|
-
* Make test file patterns configurable via Environment variables
|
233
|
-
|
234
|
-
This makes test file patterns configurable via two environment variables:
|
235
|
-
`DEFAULT_TEST`, to configure files to test, and `DEFAULT_TEST_EXCLUDE`,
|
236
|
-
to configure files to exclude from testing.
|
237
|
-
|
238
|
-
These values were hardcoded before, which made it difficult to add
|
239
|
-
new categories of tests that should not be executed by default (e.g:
|
240
|
-
smoke tests).
|
241
|
-
|
242
|
-
*Jorge Manrubia*
|
243
|
-
|
244
|
-
* No longer include `rake rdoc` task when generating plugins.
|
245
|
-
|
246
|
-
To generate docs, use the `rdoc lib` command instead.
|
15
|
+
* Add SSL support for postgresql in `bin/rails dbconsole`.
|
247
16
|
|
248
|
-
|
17
|
+
Fixes #43114.
|
249
18
|
|
250
|
-
*
|
19
|
+
*Michael Bayucot*
|
251
20
|
|
252
|
-
|
21
|
+
* Add support for comments above gem declaration in Rails application templates, e.g. `gem("nokogiri", comment: "For XML")`.
|
253
22
|
|
254
|
-
*
|
23
|
+
*Linas Juškevičius*
|
255
24
|
|
256
|
-
|
257
|
-
|
258
|
-
See the gem [README](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md) for information on how to enable it in production.
|
25
|
+
* The setter `config.autoloader=` has been deleted. `zeitwerk` is the only
|
26
|
+
available autoloading mode.
|
259
27
|
|
260
|
-
*
|
261
|
-
|
262
|
-
* `rails stats` will now count TypeScript files toward JavaScript stats.
|
263
|
-
|
264
|
-
*Joshua Cody*
|
265
|
-
|
266
|
-
* Run `git init` when generating plugins.
|
28
|
+
*Xavier Noria*
|
267
29
|
|
268
|
-
|
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/*`.
|
269
33
|
|
270
|
-
|
34
|
+
Similarly, engines can configure that collection in the class body of the
|
35
|
+
engine class or in the configuration for environments.
|
271
36
|
|
272
|
-
|
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.
|
273
40
|
|
274
|
-
|
41
|
+
*Xavier Noria*
|
275
42
|
|
276
|
-
|
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.
|
277
47
|
|
278
|
-
|
279
|
-
|
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.
|
280
51
|
|
281
|
-
|
282
|
-
`ruby script/benchmarks/opt_compare.rb`
|
52
|
+
*Xavier Noria*
|
283
53
|
|
284
|
-
|
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.
|
285
58
|
|
286
|
-
*
|
59
|
+
*Xavier Noria*
|
287
60
|
|
288
|
-
|
289
|
-
disabled in `environments/test.rb`. This implicitly disables caching
|
290
|
-
view templates too. This change will enable view template caching by
|
291
|
-
adding this to the generated `environments/test.rb`:
|
61
|
+
* Show Rake task description if command is run with `-h`.
|
292
62
|
|
293
|
-
|
294
|
-
|
295
|
-
```
|
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.
|
296
65
|
|
297
|
-
*
|
66
|
+
*Petrik de Heus*
|
298
67
|
|
299
|
-
*
|
68
|
+
* Add missing `plugin new` command to help.
|
300
69
|
|
301
|
-
|
302
|
-
move it from one place to another in the stack:
|
70
|
+
*Petrik de Heus
|
303
71
|
|
304
|
-
|
305
|
-
config.middleware.move_before ActionDispatch::Flash, Magical::Unicorns
|
306
|
-
```
|
72
|
+
* Fix `config_for` error when there's only a shared root array.
|
307
73
|
|
308
|
-
|
309
|
-
`ActionDispatch::Flash`. You can also move it after with:
|
74
|
+
*Loïc Delmaire*
|
310
75
|
|
311
|
-
|
312
|
-
config.middleware.move_after ActionDispatch::Flash, Magical::Unicorns
|
313
|
-
```
|
76
|
+
* Raise an error in generators if an index type is invalid.
|
314
77
|
|
315
|
-
*
|
78
|
+
*Petrik de Heus*
|
316
79
|
|
317
|
-
*
|
80
|
+
* `package.json` now uses a strict version constraint for Rails JavaScript packages on new Rails apps.
|
318
81
|
|
319
|
-
*
|
82
|
+
*Zachary Scott*, *Alex Ghiculescu*
|
320
83
|
|
321
|
-
*
|
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".
|
322
87
|
|
323
|
-
|
88
|
+
Fixes #40744.
|
324
89
|
|
325
|
-
|
90
|
+
*Michael Duchemin*
|
326
91
|
|
327
|
-
|
92
|
+
* Raise an error in generators if a field type is invalid.
|
328
93
|
|
329
|
-
*
|
94
|
+
*Petrik de Heus*
|
330
95
|
|
331
|
-
|
96
|
+
* `bin/rails tmp:clear` deletes also files and directories in `tmp/storage`.
|
332
97
|
|
333
|
-
|
334
|
-
config.generators do |g|
|
335
|
-
g.orm :active_record, primary_key_type: :uuid
|
336
|
-
end
|
337
|
-
```
|
98
|
+
*George Claghorn*
|
338
99
|
|
339
|
-
|
100
|
+
* Fix compatibility with `psych >= 4`.
|
340
101
|
|
341
|
-
|
342
|
-
|
343
|
-
```
|
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.
|
344
104
|
|
345
|
-
|
346
|
-
This change causes the type to be applied appropriately.
|
105
|
+
*Jean Boussier*
|
347
106
|
|
348
|
-
|
107
|
+
* Allow loading nested locales in engines.
|
349
108
|
|
350
|
-
*
|
109
|
+
*Gannon McGibbon*
|
351
110
|
|
352
|
-
|
111
|
+
* Ensure `Rails.application.config_for` always cast hashes to `ActiveSupport::OrderedOptions`.
|
353
112
|
|
354
|
-
*
|
113
|
+
*Jean Boussier*
|
355
114
|
|
356
|
-
* `
|
115
|
+
* Remove `Rack::Runtime` from the default middleware stack and deprecate
|
116
|
+
referencing it in middleware operations without adding it back.
|
357
117
|
|
358
|
-
|
359
|
-
# config/example.yml
|
360
|
-
shared:
|
361
|
-
foo:
|
362
|
-
bar:
|
363
|
-
baz: 1
|
364
|
-
development:
|
365
|
-
foo:
|
366
|
-
bar:
|
367
|
-
qux: 2
|
368
|
-
```
|
118
|
+
*Hartley McGuire*
|
369
119
|
|
370
|
-
|
371
|
-
# Previously
|
372
|
-
Rails.application.config_for(:example)[:foo][:bar] #=> { qux: 2 }
|
120
|
+
* Allow adding additional authorized hosts in development via `ENV['RAILS_DEVELOPMENT_HOSTS']`.
|
373
121
|
|
374
|
-
|
375
|
-
Rails.application.config_for(:example)[:foo][:bar] #=> { baz: 1, qux: 2 }
|
376
|
-
```
|
122
|
+
*Josh Abernathy*, *Debbie Milburn*
|
377
123
|
|
378
|
-
|
124
|
+
* Add app concern and test keepfiles to generated engine plugins.
|
379
125
|
|
380
|
-
*
|
126
|
+
*Gannon McGibbon*
|
381
127
|
|
382
|
-
|
383
|
-
# config/example.yml
|
384
|
-
development:
|
385
|
-
options:
|
386
|
-
key: value
|
387
|
-
```
|
128
|
+
* Stop generating a license for in-app plugins.
|
388
129
|
|
389
|
-
|
390
|
-
Rails.application.config_for(:example).options
|
391
|
-
```
|
130
|
+
*Gannon McGibbon*
|
392
131
|
|
393
|
-
|
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.
|
394
135
|
|
395
|
-
|
136
|
+
*Alex Ghiculescu*
|
396
137
|
|
397
|
-
*
|
398
|
-
now able to modify `autoload_paths`, `autoload_once_paths`, and
|
399
|
-
`eager_load_paths`.
|
138
|
+
* Change default branch for new Rails projects and plugins to `main`.
|
400
139
|
|
401
|
-
|
140
|
+
*Prateek Choudhary*
|
402
141
|
|
403
|
-
|
142
|
+
* The new method `Rails.benchmark` gives you a quick way to measure and log the execution time taken by a block:
|
404
143
|
|
405
|
-
|
144
|
+
def test_expensive_stuff
|
145
|
+
Rails.benchmark("test_expensive_stuff") { ... }
|
146
|
+
end
|
406
147
|
|
407
|
-
|
408
|
-
# In config/application.rb, for example.
|
409
|
-
require "#{Rails.root}/lib/my_app/config"
|
148
|
+
This functionality was available in some contexts only before.
|
410
149
|
|
411
|
-
|
412
|
-
config.foo = MyApp::Config.foo
|
413
|
-
```
|
150
|
+
*Simon Perepelitsa*
|
414
151
|
|
415
|
-
|
152
|
+
* Applications generated with `--skip-sprockets` no longer get `app/assets/config/manifest.js` and `app/assets/stylesheets/application.css`.
|
416
153
|
|
417
|
-
|
418
|
-
config.to_prepare do
|
419
|
-
config.foo = MyModel.foo
|
420
|
-
end
|
421
|
-
```
|
154
|
+
*Cindy Gao*
|
422
155
|
|
423
|
-
|
156
|
+
* Add support for stylesheets and ERB views to `rails stats`.
|
424
157
|
|
425
|
-
*
|
158
|
+
*Joel Hawksley*
|
426
159
|
|
427
|
-
*
|
160
|
+
* Allow appended root routes to take precedence over internal welcome controller.
|
428
161
|
|
429
|
-
*
|
162
|
+
*Gannon McGibbon*
|
430
163
|
|
431
164
|
|
432
|
-
Please check [6-
|
165
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/railties/CHANGELOG.md) for previous changes.
|