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