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