railties 6.0.3.4 → 6.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +235 -371
- data/MIT-LICENSE +1 -1
- data/RDOC_MAIN.rdoc +1 -1
- data/README.rdoc +1 -1
- data/lib/minitest/rails_plugin.rb +16 -1
- data/lib/rails.rb +5 -8
- data/lib/rails/api/task.rb +1 -1
- data/lib/rails/application.rb +49 -83
- data/lib/rails/application/bootstrap.rb +5 -5
- data/lib/rails/application/configuration.rb +71 -21
- data/lib/rails/application/default_middleware_stack.rb +5 -3
- data/lib/rails/application/finisher.rb +15 -2
- data/lib/rails/application/routes_reloader.rb +9 -2
- data/lib/rails/backtrace_cleaner.rb +12 -7
- data/lib/rails/code_statistics.rb +3 -3
- data/lib/rails/code_statistics_calculator.rb +6 -6
- data/lib/rails/command.rb +7 -1
- data/lib/rails/command/base.rb +1 -1
- data/lib/rails/command/behavior.rb +1 -1
- data/lib/rails/command/environment_argument.rb +1 -1
- data/lib/rails/commands/credentials/USAGE +17 -2
- data/lib/rails/commands/credentials/credentials_command.rb +28 -4
- data/lib/rails/commands/credentials/credentials_command/diffing.rb +41 -0
- data/lib/rails/commands/db/system/change/change_command.rb +6 -1
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +61 -58
- data/lib/rails/commands/encrypted/encrypted_command.rb +4 -4
- data/lib/rails/commands/generate/generate_command.rb +1 -1
- data/lib/rails/commands/notes/notes_command.rb +3 -13
- data/lib/rails/commands/rake/rake_command.rb +9 -8
- data/lib/rails/commands/secrets/USAGE +9 -3
- data/lib/rails/commands/server/server_command.rb +14 -41
- data/lib/rails/commands/test/test_command.rb +2 -2
- data/lib/rails/configuration.rb +40 -10
- data/lib/rails/engine.rb +35 -32
- data/lib/rails/engine/configuration.rb +1 -0
- data/lib/rails/engine/updater.rb +1 -1
- data/lib/rails/gem_version.rb +3 -3
- data/lib/rails/generators.rb +29 -15
- data/lib/rails/generators/actions.rb +50 -29
- data/lib/rails/generators/actions/create_migration.rb +5 -0
- data/lib/rails/generators/app_base.rb +39 -22
- data/lib/rails/generators/base.rb +14 -11
- data/lib/rails/generators/database.rb +3 -4
- data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +3 -3
- data/lib/rails/generators/generated_attribute.rb +3 -9
- data/lib/rails/generators/migration.rb +2 -1
- data/lib/rails/generators/model_helpers.rb +26 -2
- data/lib/rails/generators/named_base.rb +1 -1
- data/lib/rails/generators/rails/app/USAGE +2 -1
- data/lib/rails/generators/rails/app/app_generator.rb +89 -15
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +11 -11
- data/lib/rails/generators/rails/app/templates/Rakefile.tt +1 -1
- data/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js +1 -1
- data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +11 -11
- data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +2 -1
- data/lib/rails/generators/rails/app/templates/bin/rails.tt +5 -2
- data/lib/rails/generators/rails/app/templates/bin/rake.tt +5 -2
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +4 -4
- data/lib/rails/generators/rails/app/templates/bin/spring.tt +13 -0
- data/lib/rails/generators/rails/app/templates/bin/yarn.tt +9 -3
- data/lib/rails/generators/rails/app/templates/config.ru.tt +2 -1
- data/lib/rails/generators/rails/app/templates/config/application.rb.tt +14 -7
- data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +3 -4
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +10 -9
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +11 -10
- data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +10 -9
- data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +11 -10
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +11 -10
- data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +10 -9
- data/lib/rails/generators/rails/app/templates/config/environment.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +17 -3
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +15 -5
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +12 -1
- data/lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb.tt +4 -3
- data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +3 -1
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt +67 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +11 -0
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +6 -1
- data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/gitattributes.tt +14 -0
- data/lib/rails/generators/rails/app/templates/gitignore.tt +0 -1
- data/lib/rails/generators/rails/app/templates/package.json.tt +1 -1
- data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +5 -5
- data/lib/rails/generators/rails/assets/USAGE +2 -3
- data/lib/rails/generators/rails/benchmark/USAGE +19 -0
- data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +29 -0
- data/lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt +15 -0
- data/lib/rails/generators/rails/controller/USAGE +2 -2
- data/lib/rails/generators/rails/controller/controller_generator.rb +2 -40
- data/lib/rails/generators/rails/credentials/credentials_generator.rb +1 -1
- data/lib/rails/generators/rails/generator/USAGE +2 -2
- data/lib/rails/generators/rails/generator/templates/USAGE.tt +1 -1
- data/lib/rails/generators/rails/helper/USAGE +2 -3
- data/lib/rails/generators/rails/integration_test/USAGE +2 -2
- data/lib/rails/generators/rails/migration/USAGE +4 -4
- data/lib/rails/generators/rails/model/USAGE +15 -16
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +25 -23
- data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +10 -19
- data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +3 -10
- data/lib/rails/generators/rails/plugin/templates/Rakefile.tt +4 -18
- data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +0 -1
- data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +3 -3
- data/lib/rails/generators/rails/plugin/templates/gitignore.tt +13 -11
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%.rb.tt +1 -0
- data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/test/%namespaced_name%_test.rb.tt +4 -4
- data/lib/rails/generators/rails/plugin/templates/test/integration/navigation_test.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +0 -3
- data/lib/rails/generators/rails/resource/USAGE +4 -4
- data/lib/rails/generators/rails/resource_route/resource_route_generator.rb +2 -27
- data/lib/rails/generators/rails/scaffold/USAGE +5 -5
- data/lib/rails/generators/rails/scaffold_controller/USAGE +2 -2
- data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +6 -0
- data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +1 -1
- data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +1 -1
- data/lib/rails/generators/rails/system_test/USAGE +2 -2
- data/lib/rails/generators/rails/task/USAGE +3 -3
- data/lib/rails/generators/test_case.rb +1 -1
- data/lib/rails/generators/test_unit/controller/controller_generator.rb +2 -0
- data/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt +3 -3
- data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +2 -2
- data/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/job/templates/unit_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +1 -1
- data/lib/rails/generators/test_unit/model/templates/unit_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +2 -2
- data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +1 -1
- data/lib/rails/generators/testing/assertions.rb +2 -2
- data/lib/rails/generators/testing/behaviour.rb +1 -1
- data/lib/rails/info.rb +1 -1
- data/lib/rails/info_controller.rb +1 -1
- data/lib/rails/mailers_controller.rb +1 -0
- data/lib/rails/paths.rb +14 -6
- data/lib/rails/rack/logger.rb +1 -1
- data/lib/rails/railtie.rb +32 -10
- data/lib/rails/railtie/configuration.rb +3 -2
- data/lib/rails/source_annotation_extractor.rb +1 -15
- data/lib/rails/tasks.rb +0 -4
- data/lib/rails/tasks/engine.rake +1 -4
- data/lib/rails/tasks/framework.rake +7 -1
- data/lib/rails/tasks/misc.rake +1 -1
- data/lib/rails/tasks/statistics.rake +1 -1
- data/lib/rails/tasks/yarn.rake +14 -2
- data/lib/rails/templates/rails/mailers/email.html.erb +1 -0
- data/lib/rails/templates/rails/welcome/index.html.erb +1 -1
- data/lib/rails/test_unit/reporter.rb +2 -1
- data/lib/rails/test_unit/runner.rb +20 -3
- data/lib/rails/test_unit/testing.rake +6 -0
- metadata +24 -30
- data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt +0 -50
- data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt +0 -86
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +0 -45
- data/lib/rails/generators/rails/plugin/templates/rails/application.rb.tt +0 -23
- data/lib/rails/tasks/annotations.rake +0 -22
- data/lib/rails/tasks/dev.rake +0 -11
- data/lib/rails/tasks/initializers.rake +0 -9
- data/lib/rails/tasks/routes.rake +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f95a5e8436f261b26ce4c66e79858252dd5537abbadd42b11c37041875479a50
|
4
|
+
data.tar.gz: 9cea22465cff4bacad402bb460e45f526ec3d90b3b5266677a118554d14f767d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c2dd30ae919200539977d3732587a07cc6746201cb649fce19b94e90e46295b97c10176548d9a31807ab96a049cb304d2fa2ba9949b8a4f4c0e39ba981c10a2
|
7
|
+
data.tar.gz: 1dbdd0412d69d4a58b0f76ebfd5dc4accb6f2c8a695dacb2f8d66b2bc92e032a247f8c622afbd4e39edbfd7406a06ff12dc1e91708d880a43e1f4a946e288196
|
data/CHANGELOG.md
CHANGED
@@ -1,525 +1,389 @@
|
|
1
|
-
## Rails 6.
|
1
|
+
## Rails 6.1.2 (February 09, 2021) ##
|
2
2
|
|
3
3
|
* No changes.
|
4
4
|
|
5
5
|
|
6
|
-
## Rails 6.
|
7
|
-
|
8
|
-
* No changes.
|
6
|
+
## Rails 6.1.1 (January 07, 2021) ##
|
9
7
|
|
8
|
+
* Allow spaces in path to Yarn binstub and only run on precompile if needed.
|
10
9
|
|
11
|
-
|
10
|
+
*Markus Doits*
|
12
11
|
|
13
|
-
*
|
12
|
+
* Populate ARGV for app template.
|
14
13
|
|
14
|
+
Fixes #40945.
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
* No changes.
|
16
|
+
*Jonathan Hefner*
|
19
17
|
|
20
18
|
|
21
|
-
## Rails 6.0
|
19
|
+
## Rails 6.1.0 (December 09, 2020) ##
|
22
20
|
|
23
|
-
*
|
21
|
+
* Added `Railtie#server` hook called when Rails starts a server.
|
22
|
+
This is useful in case your application or a library needs to run
|
23
|
+
another process next to the Rails server. This is quite common in development
|
24
|
+
for instance to run the Webpack or the React server.
|
24
25
|
|
25
|
-
|
26
|
-
disabled in `environments/test.rb`. This implicitly disables caching
|
27
|
-
view templates too. This change will enable view template caching by
|
28
|
-
adding this to the generated `environments/test.rb`:
|
26
|
+
It can be used like this:
|
29
27
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
manually as it was possible in previous versions.
|
38
|
-
|
39
|
-
Please, note this is not integrated with the whole eager loading logic that
|
40
|
-
runs when Rails boots with eager loading enabled, you can think of this
|
41
|
-
method as a vanilla recursive code loader.
|
42
|
-
|
43
|
-
This ability has been restored because there are some use cases for it, such
|
44
|
-
as indexers that need to have all application classes and modules in memory.
|
45
|
-
|
46
|
-
*Xavier Noria*
|
28
|
+
```ruby
|
29
|
+
class MyRailtie < Rails::Railtie
|
30
|
+
server do
|
31
|
+
WebpackServer.run
|
32
|
+
end
|
33
|
+
end
|
34
|
+
```
|
47
35
|
|
48
|
-
*
|
36
|
+
*Edouard Chin*
|
49
37
|
|
50
|
-
|
38
|
+
* Remove deprecated `rake dev:cache` tasks.
|
51
39
|
|
52
|
-
*
|
53
|
-
namespaces which do not have eager load paths, like the recently added
|
54
|
-
`i18n`. These namespaces are only required to respond to `eager_load!`.
|
40
|
+
*Rafael Mendonça França*
|
55
41
|
|
56
|
-
|
42
|
+
* Remove deprecated `rake routes` tasks.
|
57
43
|
|
44
|
+
*Rafael Mendonça França*
|
58
45
|
|
59
|
-
|
46
|
+
* Remove deprecated `rake initializers` tasks.
|
60
47
|
|
61
|
-
*
|
48
|
+
*Rafael Mendonça França*
|
62
49
|
|
50
|
+
* Remove deprecated support for using the `HOST` environment variable to specify the server IP.
|
63
51
|
|
64
|
-
|
52
|
+
*Rafael Mendonça França*
|
65
53
|
|
66
|
-
*
|
54
|
+
* Remove deprecated `server` argument from the rails server command.
|
67
55
|
|
56
|
+
*Rafael Mendonça França*
|
68
57
|
|
69
|
-
|
58
|
+
* Remove deprecated `SOURCE_ANNOTATION_DIRECTORIES` environment variable support from `rails notes`.
|
70
59
|
|
71
|
-
*
|
60
|
+
*Rafael Mendonça França*
|
72
61
|
|
73
|
-
|
62
|
+
* Remove deprecated `connection` option in the `rails dbconsole` command.
|
74
63
|
|
75
|
-
|
64
|
+
*Rafael Mendonça França*
|
76
65
|
|
77
|
-
*
|
78
|
-
directory, as in engines loaded from gems.
|
66
|
+
* Remove depreated `rake notes` tasks.
|
79
67
|
|
80
|
-
*
|
68
|
+
*Rafael Mendonça França*
|
81
69
|
|
82
|
-
*
|
70
|
+
* Return a 405 Method Not Allowed response when a request uses an unknown HTTP method.
|
83
71
|
|
84
|
-
|
72
|
+
Fixes #38998.
|
85
73
|
|
86
|
-
*
|
87
|
-
included in the default `.gitignore` file for newly-generated apps.
|
74
|
+
*Loren Norman*
|
88
75
|
|
89
|
-
|
76
|
+
* Make railsrc file location xdg-specification compliant
|
90
77
|
|
91
|
-
|
92
|
-
|
78
|
+
`rails new` will now look for the default `railsrc` file at
|
79
|
+
`$XDG_CONFIG_HOME/rails/railsrc` (or `~/.config/rails/railsrc` if
|
80
|
+
`XDG_CONFIG_HOME` is not set). If this file does not exist, `rails new`
|
81
|
+
will fall back to `~/.railsrc`.
|
93
82
|
|
94
|
-
|
83
|
+
The fallback behaviour means this does not cause any breaking changes.
|
95
84
|
|
85
|
+
*Nick Wolf*
|
96
86
|
|
97
|
-
|
87
|
+
* Change the default logging level from :debug to :info to avoid inadvertent exposure of personally
|
88
|
+
identifiable information (PII) in production environments.
|
98
89
|
|
99
|
-
*
|
100
|
-
loaders printed to standard output. May be handy for troubleshooting.
|
90
|
+
*Eric M. Payne*
|
101
91
|
|
102
|
-
|
92
|
+
* Automatically generate abstract class when using multiple databases.
|
103
93
|
|
94
|
+
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.
|
104
95
|
|
105
|
-
|
96
|
+
Usage:
|
106
97
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
mode early, in `config/application.rb`.
|
98
|
+
```bash
|
99
|
+
$ bin/rails generate scaffold Pet name:string --database=animals
|
100
|
+
```
|
111
101
|
|
112
|
-
|
113
|
-
`:zeitwerk` mode do not need `require_dependency`, so models, controllers,
|
114
|
-
jobs, etc. do not need to be in `$LOAD_PATH`. Setting this to `false` saves
|
115
|
-
Ruby from checking these directories when resolving `require` calls with
|
116
|
-
relative paths, and saves Bootsnap work and RAM, since it does not need to
|
117
|
-
build an index for them.
|
102
|
+
Will create an abstract class for the animals connection.
|
118
103
|
|
119
|
-
|
104
|
+
```ruby
|
105
|
+
class AnimalsRecord < ApplicationRecord
|
106
|
+
self.abstract_class = true
|
120
107
|
|
121
|
-
|
108
|
+
connects_to database: { writing: :animals }
|
109
|
+
end
|
110
|
+
```
|
122
111
|
|
123
|
-
|
112
|
+
And generate a `Pet` model that inherits from the new `AnimalsRecord`:
|
124
113
|
|
125
|
-
```
|
126
|
-
|
114
|
+
```ruby
|
115
|
+
class Pet < AnimalsRecord
|
116
|
+
end
|
127
117
|
```
|
128
118
|
|
129
|
-
|
130
|
-
autoloader is compatible with `:zeitwerk` mode.
|
119
|
+
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.
|
131
120
|
|
132
|
-
|
121
|
+
```bash
|
122
|
+
$ bin/rails generate scaffold Pet name:string --database=animals --parent=SecondaryBase
|
123
|
+
```
|
133
124
|
|
134
|
-
|
125
|
+
This will ensure the model inherits from the `SecondaryBase` parent instead of `AnimalsRecord`
|
135
126
|
|
136
|
-
|
127
|
+
```ruby
|
128
|
+
class Pet < SecondaryBase
|
129
|
+
end
|
130
|
+
```
|
137
131
|
|
138
|
-
*
|
132
|
+
*Eileen M. Uchitelle*, *John Crepezzi*
|
139
133
|
|
140
|
-
*
|
141
|
-
`belongs_to` / `references` association generated by model generator.
|
134
|
+
* Accept params from url to prepopulate the Inbound Emails form in Rails conductor.
|
142
135
|
|
143
|
-
|
136
|
+
*Chris Oliver*
|
144
137
|
|
145
|
-
|
138
|
+
* Create a new rails app using a minimal stack.
|
146
139
|
|
147
|
-
|
148
|
-
unless `--skip-spring`.
|
140
|
+
`rails new cool_app --minimal`
|
149
141
|
|
150
|
-
|
142
|
+
All the following are excluded from your minimal stack:
|
151
143
|
|
152
|
-
|
144
|
+
- action_cable
|
145
|
+
- action_mailbox
|
146
|
+
- action_mailer
|
147
|
+
- action_text
|
148
|
+
- active_job
|
149
|
+
- active_storage
|
150
|
+
- bootsnap
|
151
|
+
- jbuilder
|
152
|
+
- spring
|
153
|
+
- system_tests
|
154
|
+
- turbolinks
|
155
|
+
- webpack
|
153
156
|
|
154
|
-
*
|
157
|
+
*Haroon Ahmed*, *DHH*
|
155
158
|
|
156
|
-
*
|
159
|
+
* Add default ENV variable option with BACKTRACE to turn off backtrace cleaning when debugging framework code in the
|
160
|
+
generated config/initializers/backtrace_silencers.rb.
|
157
161
|
|
158
|
-
|
162
|
+
`BACKTRACE=1 ./bin/rails runner "MyClass.perform"`
|
159
163
|
|
160
|
-
*
|
161
|
-
favor of `database` option.
|
164
|
+
*DHH*
|
162
165
|
|
163
|
-
|
166
|
+
* The autoloading guide for Zeitwerk mode documents how to autoload classes
|
167
|
+
during application boot in a safe way.
|
164
168
|
|
165
|
-
*
|
166
|
-
`chromedriver-helper` is deprecated as of March 31, 2019 and won't
|
167
|
-
receive any further updates.
|
169
|
+
*Haroon Ahmed*, *Xavier Noria*
|
168
170
|
|
169
|
-
|
171
|
+
* The `classic` autoloader starts its deprecation cycle.
|
170
172
|
|
171
|
-
|
172
|
-
to upgrade `bootsnap` to at least 1.4.2.
|
173
|
+
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.
|
173
174
|
|
174
175
|
*Xavier Noria*
|
175
176
|
|
176
|
-
*
|
177
|
+
* Adds `rails test:all` for running all tests in the test directory.
|
177
178
|
|
178
|
-
This
|
179
|
-
developer from accidentally starting a sandbox console,
|
180
|
-
which when left inactive, can cause the database server to run out of memory.
|
179
|
+
This runs all test files in the test directory, including system tests.
|
181
180
|
|
182
|
-
*
|
181
|
+
*Niklas Häusele*
|
183
182
|
|
184
|
-
* Add
|
185
|
-
|
186
|
-
*Yuji Yaginuma*
|
183
|
+
* Add `config.generators.after_generate` for processing to generated files.
|
187
184
|
|
185
|
+
Register a callback that will get called right after generators has finished.
|
188
186
|
|
189
|
-
|
190
|
-
|
191
|
-
* Generate random development secrets
|
187
|
+
*Yuji Yaginuma*
|
192
188
|
|
193
|
-
|
189
|
+
* Make test file patterns configurable via Environment variables
|
194
190
|
|
195
|
-
This
|
196
|
-
|
191
|
+
This makes test file patterns configurable via two environment variables:
|
192
|
+
`DEFAULT_TEST`, to configure files to test, and `DEFAULT_TEST_EXCLUDE`,
|
193
|
+
to configure files to exclude from testing.
|
197
194
|
|
198
|
-
|
195
|
+
These values were hardcoded before, which made it difficult to add
|
196
|
+
new categories of tests that should not be executed by default (e.g:
|
197
|
+
smoke tests).
|
199
198
|
|
200
|
-
*
|
199
|
+
*Jorge Manrubia*
|
201
200
|
|
201
|
+
* No longer include `rake rdoc` task when generating plugins.
|
202
202
|
|
203
|
-
|
203
|
+
To generate docs, use the `rdoc lib` command instead.
|
204
204
|
|
205
|
-
*
|
206
|
-
being broken by allowing non-symbol access with a deprecation notice.
|
205
|
+
*Jonathan Hefner*
|
207
206
|
|
208
|
-
|
207
|
+
* Allow relative paths with trailing slashes to be passed to `rails test`.
|
209
208
|
|
210
|
-
*
|
209
|
+
*Eugene Kenny*
|
211
210
|
|
212
|
-
|
211
|
+
* Add `rack-mini-profiler` gem to the default `Gemfile`.
|
213
212
|
|
213
|
+
`rack-mini-profiler` displays performance information such as SQL time and flame graphs.
|
214
|
+
It's enabled by default in development environment, but can be enabled in production as well.
|
215
|
+
See the gem [README](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md) for information on how to enable it in production.
|
214
216
|
|
215
|
-
|
217
|
+
*Osama Sayegh*
|
216
218
|
|
217
|
-
*
|
219
|
+
* `rails stats` will now count TypeScript files toward JavaScript stats.
|
218
220
|
|
219
|
-
*
|
221
|
+
*Joshua Cody*
|
220
222
|
|
221
|
-
*
|
223
|
+
* Run `git init` when generating plugins.
|
222
224
|
|
223
|
-
|
225
|
+
Opt out with `--skip-git`.
|
224
226
|
|
225
|
-
*
|
227
|
+
*OKURA Masafumi*
|
226
228
|
|
227
|
-
|
229
|
+
* Add benchmark generator.
|
228
230
|
|
229
|
-
|
231
|
+
Introduce benchmark generator to benchmark Rails applications.
|
230
232
|
|
231
|
-
|
233
|
+
`rails generate benchmark opt_compare`
|
232
234
|
|
233
|
-
|
235
|
+
This creates a benchmark file that uses [`benchmark-ips`](https://github.com/evanphx/benchmark-ips).
|
236
|
+
By default, two code blocks can be benchmarked using the `before` and `after` reports.
|
234
237
|
|
235
|
-
|
238
|
+
You can run the generated benchmark file using:
|
239
|
+
`ruby script/benchmarks/opt_compare.rb`
|
236
240
|
|
237
|
-
*
|
241
|
+
*Kevin Jalbert*, *Gannon McGibbon*
|
238
242
|
|
239
|
-
|
243
|
+
* Cache compiled view templates when running tests by default.
|
240
244
|
|
241
|
-
|
245
|
+
When generating a new app without `--skip-spring`, caching classes is
|
246
|
+
disabled in `environments/test.rb`. This implicitly disables caching
|
247
|
+
view templates too. This change will enable view template caching by
|
248
|
+
adding this to the generated `environments/test.rb`:
|
242
249
|
|
250
|
+
```ruby
|
251
|
+
config.action_view.cache_template_loading = true
|
243
252
|
```
|
244
|
-
bin/rails db:system:change --to=postgresql
|
245
|
-
force config/database.yml
|
246
|
-
gsub Gemfile
|
247
|
-
```
|
248
|
-
|
249
|
-
The change command copies a template `config/database.yml` with
|
250
|
-
the target database adapter into your app, and replaces your database gem
|
251
|
-
with the target database gem.
|
252
|
-
|
253
|
-
*Gannon McGibbon*
|
254
|
-
|
255
|
-
* Add `rails test:channels`.
|
256
|
-
|
257
|
-
*bogdanvlviv*
|
258
|
-
|
259
|
-
* Use original `bundler` environment variables during the process of generating a new rails project.
|
260
|
-
|
261
|
-
*Marco Costa*
|
262
|
-
|
263
|
-
* Send Active Storage analysis and purge jobs to dedicated queues by default.
|
264
|
-
|
265
|
-
Analysis jobs now use the `:active_storage_analysis` queue, and purge jobs
|
266
|
-
now use the `:active_storage_purge` queue. This matches Action Mailbox,
|
267
|
-
which sends its jobs to dedicated queues by default.
|
268
|
-
|
269
|
-
*George Claghorn*
|
270
253
|
|
271
|
-
*
|
272
|
-
|
273
|
-
*George Claghorn*
|
274
|
-
|
275
|
-
* Introduce guard against DNS rebinding attacks.
|
276
|
-
|
277
|
-
The `ActionDispatch::HostAuthorization` is a new middleware that prevents
|
278
|
-
against DNS rebinding and other `Host` header attacks. It is included in
|
279
|
-
the development environment by default with the following configuration:
|
280
|
-
|
281
|
-
Rails.application.config.hosts = [
|
282
|
-
IPAddr.new("0.0.0.0/0"), # All IPv4 addresses.
|
283
|
-
IPAddr.new("::/0"), # All IPv6 addresses.
|
284
|
-
"localhost" # The localhost reserved domain.
|
285
|
-
]
|
286
|
-
|
287
|
-
In other environments `Rails.application.config.hosts` is empty and no
|
288
|
-
`Host` header checks will be done. If you want to guard against header
|
289
|
-
attacks on production, you have to manually permit the allowed hosts
|
290
|
-
with:
|
254
|
+
*Jorge Manrubia*
|
291
255
|
|
292
|
-
|
256
|
+
* Introduce middleware move operations.
|
293
257
|
|
294
|
-
|
295
|
-
|
296
|
-
`Proc` and `IPAddr` to name a few. Here is an example with a regexp.
|
258
|
+
With this change, you no longer need to delete and reinsert a middleware to
|
259
|
+
move it from one place to another in the stack:
|
297
260
|
|
298
|
-
|
299
|
-
|
300
|
-
|
261
|
+
```ruby
|
262
|
+
config.middleware.move_before ActionDispatch::Flash, Magical::Unicorns
|
263
|
+
```
|
301
264
|
|
302
|
-
|
265
|
+
This will move the `Magical::Unicorns` middleware before
|
266
|
+
`ActionDispatch::Flash`. You can also move it after with:
|
303
267
|
|
304
|
-
|
305
|
-
|
306
|
-
|
268
|
+
```ruby
|
269
|
+
config.middleware.move_after ActionDispatch::Flash, Magical::Unicorns
|
270
|
+
```
|
307
271
|
|
308
272
|
*Genadi Samokovarov*
|
309
273
|
|
310
|
-
*
|
311
|
-
|
312
|
-
*Gannon McGibbon*
|
313
|
-
|
314
|
-
* Remove redundant suffixes on generated integration tests.
|
315
|
-
|
316
|
-
*Gannon McGibbon*
|
317
|
-
|
318
|
-
* Fix boolean interaction in scaffold system tests.
|
319
|
-
|
320
|
-
*Gannon McGibbon*
|
321
|
-
|
322
|
-
* Remove redundant suffixes on generated system tests.
|
323
|
-
|
324
|
-
*Gannon McGibbon*
|
325
|
-
|
326
|
-
* Add an `abort_on_failure` boolean option to the generator method that shell
|
327
|
-
out (`generate`, `rake`, `rails_command`) to abort the generator if the
|
328
|
-
command fails.
|
329
|
-
|
330
|
-
*David Rodríguez*
|
274
|
+
* Generators that inherit from NamedBase respect `--force` option.
|
331
275
|
|
332
|
-
*
|
333
|
-
|
334
|
-
*Gannon McGibbon*
|
335
|
-
|
336
|
-
* Use Ids instead of memory addresses when displaying references in scaffold views.
|
337
|
-
|
338
|
-
Fixes #29200.
|
276
|
+
*Josh Brody*
|
339
277
|
|
340
|
-
|
278
|
+
* Allow configuration of eager_load behaviour for rake environment:
|
341
279
|
|
342
|
-
|
343
|
-
Subtasks are also added to get the status of individual databases (eg. `rails db:migrate:status:animals`).
|
280
|
+
config.rake_eager_load
|
344
281
|
|
345
|
-
|
282
|
+
Defaults to `false` as per previous behaviour.
|
346
283
|
|
347
|
-
*
|
348
|
-
Sprockets is now solely in charge, by default, of compiling CSS and other static assets.
|
349
|
-
Action Cable channel generators will create ES6 stubs rather than use CoffeeScript.
|
350
|
-
Active Storage, Action Cable, Turbolinks, and Rails-UJS are loaded by a new application.js pack.
|
351
|
-
Generators no longer generate JavaScript stubs.
|
284
|
+
*Thierry Joyal*
|
352
285
|
|
353
|
-
|
286
|
+
* Ensure Rails migration generator respects system-wide primary key config.
|
354
287
|
|
355
|
-
|
356
|
-
setting the database. This is useful for applications that use
|
357
|
-
multiple databases and put migrations per database in their own directories.
|
288
|
+
When rails is configured to use a specific primary key type:
|
358
289
|
|
290
|
+
```ruby
|
291
|
+
config.generators do |g|
|
292
|
+
g.orm :active_record, primary_key_type: :uuid
|
293
|
+
end
|
359
294
|
```
|
360
|
-
bin/rails g model Room capacity:integer --database=kingston
|
361
|
-
invoke active_record
|
362
|
-
create db/kingston_migrate/20180830151055_create_rooms.rb
|
363
|
-
```
|
364
|
-
|
365
|
-
Because rails scaffolding uses the model generator, you can
|
366
|
-
also specify a database with the scaffold generator.
|
367
|
-
|
368
|
-
*Gannon McGibbon*
|
369
|
-
|
370
|
-
* Raise an error when "recyclable cache keys" are being used by a cache store
|
371
|
-
that does not explicitly support it. Custom cache keys that do support this feature
|
372
|
-
can bypass this error by implementing the `supports_cache_versioning?` method on their
|
373
|
-
class and returning a truthy value.
|
374
|
-
|
375
|
-
*Richard Schneeman*
|
376
|
-
|
377
|
-
* Support environment specific credentials overrides.
|
378
|
-
|
379
|
-
So any environment will look for `config/credentials/#{Rails.env}.yml.enc` and fall back
|
380
|
-
to `config/credentials.yml.enc`.
|
381
|
-
|
382
|
-
The encryption key can be in `ENV["RAILS_MASTER_KEY"]` or `config/credentials/production.key`.
|
383
|
-
|
384
|
-
Environment credentials overrides can be edited with `rails credentials:edit --environment production`.
|
385
|
-
If no override is set up for the passed environment, it will be created.
|
386
|
-
|
387
|
-
Additionally, the default lookup paths can be overwritten with these configs:
|
388
|
-
|
389
|
-
- `config.credentials.content_path`
|
390
|
-
- `config.credentials.key_path`
|
391
|
-
|
392
|
-
*Wojciech Wnętrzak*
|
393
|
-
|
394
|
-
* Make `ActiveSupport::Cache::NullStore` the default cache store in the test environment.
|
395
295
|
|
396
|
-
|
397
|
-
|
398
|
-
* Emit warning for unknown inflection rule when generating model.
|
399
|
-
|
400
|
-
*Yoshiyuki Kinjo*
|
401
|
-
|
402
|
-
* Add `database` (aliased as `db`) option to migration generator.
|
403
|
-
|
404
|
-
If you're using multiple databases and have a folder for each database
|
405
|
-
for migrations (ex db/migrate and db/new_db_migrate) you can now pass the
|
406
|
-
`--database` option to the generator to make sure the the migration
|
407
|
-
is inserted into the correct folder.
|
296
|
+
Previously:
|
408
297
|
|
298
|
+
```bash
|
299
|
+
$ bin/rails g migration add_location_to_users location:references
|
409
300
|
```
|
410
|
-
rails g migration CreateHouses --database=kingston
|
411
|
-
invoke active_record
|
412
|
-
create db/kingston_migrate/20180830151055_create_houses.rb
|
413
|
-
```
|
414
|
-
|
415
|
-
*Eileen M. Uchitelle*
|
416
|
-
|
417
|
-
* Deprecate `rake routes` in favor of `rails routes`.
|
418
|
-
|
419
|
-
*Yuji Yaginuma*
|
420
|
-
|
421
|
-
* Deprecate `rake initializers` in favor of `rails initializers`.
|
422
|
-
|
423
|
-
*Annie-Claude Côté*
|
424
|
-
|
425
|
-
* Deprecate `rake dev:cache` in favor of `rails dev:cache`.
|
426
|
-
|
427
|
-
*Annie-Claude Côté*
|
428
|
-
|
429
|
-
* Deprecate `rails notes` subcommands in favor of passing an `annotations` argument to `rails notes`.
|
430
|
-
|
431
|
-
The following subcommands are replaced by passing `--annotations` or `-a` to `rails notes`:
|
432
|
-
- `rails notes:custom ANNOTATION=custom` is deprecated in favor of using `rails notes -a custom`.
|
433
|
-
- `rails notes:optimize` is deprecated in favor of using `rails notes -a OPTIMIZE`.
|
434
|
-
- `rails notes:todo` is deprecated in favor of using`rails notes -a TODO`.
|
435
|
-
- `rails notes:fixme` is deprecated in favor of using `rails notes -a FIXME`.
|
436
|
-
|
437
|
-
*Annie-Claude Côté*
|
438
301
|
|
439
|
-
|
440
|
-
|
302
|
+
The references line in the migration would not have `type: :uuid`.
|
303
|
+
This change causes the type to be applied appropriately.
|
441
304
|
|
442
|
-
*
|
305
|
+
*Louis-Michel Couture*, *Dermot Haughey*
|
443
306
|
|
444
|
-
* Deprecate `
|
307
|
+
* Deprecate `Rails::DBConsole#config`.
|
445
308
|
|
446
|
-
|
309
|
+
`Rails::DBConsole#config` is deprecated without replacement. Use `Rails::DBConsole.db_config.configuration_hash` instead.
|
447
310
|
|
448
|
-
*
|
311
|
+
*Eileen M. Uchitelle*, *John Crepezzi*
|
449
312
|
|
450
|
-
|
313
|
+
* `Rails.application.config_for` merges shared configuration deeply.
|
451
314
|
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
$ ls -l config/master.key
|
464
|
-
-rw-r--r-- 1 owner group 32 Jan 1 00:00 master.key
|
465
|
-
|
466
|
-
Now:
|
315
|
+
```yaml
|
316
|
+
# config/example.yml
|
317
|
+
shared:
|
318
|
+
foo:
|
319
|
+
bar:
|
320
|
+
baz: 1
|
321
|
+
development:
|
322
|
+
foo:
|
323
|
+
bar:
|
324
|
+
qux: 2
|
325
|
+
```
|
467
326
|
|
468
|
-
|
469
|
-
|
327
|
+
```ruby
|
328
|
+
# Previously
|
329
|
+
Rails.application.config_for(:example)[:foo][:bar] #=> { qux: 2 }
|
470
330
|
|
471
|
-
|
331
|
+
# Now
|
332
|
+
Rails.application.config_for(:example)[:foo][:bar] #=> { baz: 1, qux: 2 }
|
333
|
+
```
|
472
334
|
|
473
|
-
*
|
335
|
+
*Yuhei Kiriyama*
|
474
336
|
|
475
|
-
*
|
337
|
+
* Remove access to values in nested hashes returned by `Rails.application.config_for` via String keys.
|
476
338
|
|
477
|
-
|
339
|
+
```yaml
|
340
|
+
# config/example.yml
|
341
|
+
development:
|
342
|
+
options:
|
343
|
+
key: value
|
344
|
+
```
|
478
345
|
|
479
|
-
|
346
|
+
```ruby
|
347
|
+
Rails.application.config_for(:example).options
|
348
|
+
```
|
480
349
|
|
481
|
-
|
350
|
+
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.
|
482
351
|
|
483
|
-
|
352
|
+
*Étienne Barrié*
|
484
353
|
|
485
|
-
|
354
|
+
* Configuration files for environments (`config/environments/*.rb`) are
|
355
|
+
now able to modify `autoload_paths`, `autoload_once_paths`, and
|
356
|
+
`eager_load_paths`.
|
486
357
|
|
487
|
-
|
358
|
+
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.
|
488
359
|
|
489
|
-
|
490
|
-
`--using` option with the `-u` short switch.
|
360
|
+
Ways to use application code in these files:
|
491
361
|
|
492
|
-
|
362
|
+
* 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.
|
493
363
|
|
494
|
-
|
364
|
+
```ruby
|
365
|
+
# In config/application.rb, for example.
|
366
|
+
require "#{Rails.root}/lib/my_app/config"
|
495
367
|
|
496
|
-
|
497
|
-
|
368
|
+
# In config/environments/development.rb, for example.
|
369
|
+
config.foo = MyApp::Config.foo
|
370
|
+
```
|
498
371
|
|
499
|
-
*
|
372
|
+
* If the class has to be reloadable, then wrap the configuration code in a `to_prepare` block:
|
500
373
|
|
501
|
-
|
502
|
-
|
374
|
+
```ruby
|
375
|
+
config.to_prepare do
|
376
|
+
config.foo = MyModel.foo
|
377
|
+
end
|
378
|
+
```
|
503
379
|
|
504
|
-
|
505
|
-
$ rails routes --expanded
|
506
|
-
--[ Route 1 ]------------------------------------------------------------
|
507
|
-
Prefix | high_scores
|
508
|
-
Verb | GET
|
509
|
-
URI | /high_scores(.:format)
|
510
|
-
Controller#Action | high_scores#index
|
511
|
-
--[ Route 2 ]------------------------------------------------------------
|
512
|
-
Prefix | new_high_score
|
513
|
-
Verb | GET
|
514
|
-
URI | /high_scores/new(.:format)
|
515
|
-
Controller#Action | high_scores#new
|
516
|
-
```
|
380
|
+
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.
|
517
381
|
|
518
|
-
*
|
382
|
+
*Allen Hsu* & *Xavier Noria*
|
519
383
|
|
520
|
-
*
|
384
|
+
* Support using environment variable to set pidfile.
|
521
385
|
|
522
|
-
*
|
386
|
+
*Ben Thorner*
|
523
387
|
|
524
388
|
|
525
|
-
Please check [
|
389
|
+
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/railties/CHANGELOG.md) for previous changes.
|