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