railties 5.2.2.1 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +338 -119
- data/MIT-LICENSE +1 -1
- data/RDOC_MAIN.rdoc +38 -32
- data/README.rdoc +2 -2
- data/lib/minitest/rails_plugin.rb +7 -11
- data/lib/rails.rb +5 -0
- data/lib/rails/all.rb +4 -0
- data/lib/rails/api/generator.rb +2 -1
- data/lib/rails/api/task.rb +17 -0
- data/lib/rails/app_loader.rb +2 -2
- data/lib/rails/app_updater.rb +3 -1
- data/lib/rails/application.rb +73 -30
- data/lib/rails/application/bootstrap.rb +2 -10
- data/lib/rails/application/configuration.rb +114 -13
- data/lib/rails/application/default_middleware_stack.rb +3 -0
- data/lib/rails/application/dummy_erb_compiler.rb +18 -0
- data/lib/rails/application/finisher.rb +54 -0
- data/lib/rails/autoloaders.rb +48 -0
- data/lib/rails/backtrace_cleaner.rb +5 -17
- data/lib/rails/code_statistics.rb +3 -3
- data/lib/rails/command.rb +11 -10
- data/lib/rails/command/actions.rb +10 -0
- data/lib/rails/command/base.rb +16 -4
- data/lib/rails/command/behavior.rb +7 -48
- data/lib/rails/command/environment_argument.rb +8 -15
- data/lib/rails/command/spellchecker.rb +58 -0
- data/lib/rails/commands/console/console_command.rb +6 -0
- data/lib/rails/commands/credentials/USAGE +19 -1
- data/lib/rails/commands/credentials/credentials_command.rb +54 -21
- data/lib/rails/commands/db/system/change/change_command.rb +20 -0
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +20 -8
- data/lib/rails/commands/dev/dev_command.rb +19 -0
- data/lib/rails/commands/encrypted/USAGE +28 -0
- data/lib/rails/commands/encrypted/encrypted_command.rb +3 -2
- data/lib/rails/commands/help/help_command.rb +1 -1
- data/lib/rails/commands/initializers/initializers_command.rb +23 -0
- data/lib/rails/commands/new/new_command.rb +2 -2
- data/lib/rails/commands/notes/notes_command.rb +39 -0
- data/lib/rails/commands/plugin/plugin_command.rb +1 -1
- data/lib/rails/commands/routes/routes_command.rb +37 -0
- data/lib/rails/commands/runner/runner_command.rb +13 -9
- data/lib/rails/commands/secrets/USAGE +3 -3
- data/lib/rails/commands/secrets/secrets_command.rb +3 -3
- data/lib/rails/commands/server/server_command.rb +113 -50
- data/lib/rails/configuration.rb +1 -7
- data/lib/rails/engine.rb +44 -18
- data/lib/rails/engine/configuration.rb +5 -2
- data/lib/rails/gem_version.rb +3 -3
- data/lib/rails/generators.rb +11 -10
- data/lib/rails/generators/actions.rb +52 -39
- data/lib/rails/generators/app_base.rb +60 -98
- data/lib/rails/generators/app_name.rb +50 -0
- data/lib/rails/generators/base.rb +4 -0
- data/lib/rails/generators/database.rb +58 -0
- data/lib/rails/generators/erb/mailer/mailer_generator.rb +1 -1
- data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +6 -3
- data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +1 -1
- data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +9 -1
- data/lib/rails/generators/generated_attribute.rb +53 -27
- data/lib/rails/generators/migration.rb +1 -2
- data/lib/rails/generators/model_helpers.rb +8 -1
- data/lib/rails/generators/named_base.rb +2 -6
- data/lib/rails/generators/rails/app/app_generator.rb +38 -71
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +8 -11
- data/lib/rails/generators/rails/app/templates/app/assets/config/manifest.js.tt +0 -3
- data/lib/rails/generators/rails/app/templates/app/{assets/javascripts/cable.js.tt → javascript/channels/consumer.js} +2 -9
- data/lib/rails/generators/rails/app/templates/app/javascript/channels/index.js +5 -0
- data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +23 -0
- data/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt +5 -0
- data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +4 -4
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +7 -7
- data/lib/rails/generators/rails/app/templates/config/application.rb.tt +2 -0
- data/lib/rails/generators/rails/app/templates/config/cable.yml.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +4 -4
- data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +6 -6
- data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +5 -2
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +28 -12
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +13 -6
- data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +7 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +45 -0
- data/lib/rails/generators/rails/app/templates/config/locales/en.yml +1 -1
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +7 -3
- data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/spring.rb.tt +6 -6
- data/lib/rails/generators/rails/app/templates/gitignore.tt +3 -7
- data/lib/rails/generators/rails/app/templates/package.json.tt +7 -1
- data/lib/rails/generators/rails/app/templates/public/robots.txt +1 -1
- data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -1
- data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +11 -0
- data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +7 -0
- data/lib/rails/generators/rails/assets/USAGE +1 -4
- data/lib/rails/generators/rails/assets/assets_generator.rb +0 -1
- data/lib/rails/generators/rails/controller/controller_generator.rb +11 -1
- data/lib/rails/generators/rails/credentials/credentials_generator.rb +7 -8
- data/lib/rails/generators/rails/db/system/change/change_generator.rb +65 -0
- data/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb +4 -5
- data/lib/rails/generators/rails/helper/helper_generator.rb +5 -0
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +9 -33
- data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/app/helpers/%namespaced_name%/application_helper.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/app/jobs/%namespaced_name%/application_job.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/gitignore.tt +2 -1
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/railtie.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +1 -2
- data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +14 -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/resource_helpers.rb +1 -6
- data/lib/rails/generators/test_unit/integration/integration_generator.rb +6 -0
- data/lib/rails/generators/test_unit/job/job_generator.rb +5 -0
- data/lib/rails/generators/test_unit/mailer/mailer_generator.rb +1 -1
- data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +2 -2
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +12 -2
- data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +8 -0
- data/lib/rails/generators/test_unit/system/system_generator.rb +5 -0
- data/lib/rails/generators/testing/behaviour.rb +3 -0
- data/lib/rails/info.rb +3 -3
- data/lib/rails/info_controller.rb +1 -1
- data/lib/rails/mailers_controller.rb +7 -4
- data/lib/rails/paths.rb +19 -9
- data/lib/rails/railtie.rb +1 -1
- data/lib/rails/ruby_version_check.rb +3 -3
- data/lib/rails/secrets.rb +0 -1
- data/lib/rails/source_annotation_extractor.rb +138 -117
- data/lib/rails/tasks.rb +1 -0
- data/lib/rails/tasks/annotations.rake +9 -9
- data/lib/rails/tasks/dev.rake +5 -4
- data/lib/rails/tasks/framework.rake +5 -1
- data/lib/rails/tasks/initializers.rake +5 -4
- data/lib/rails/tasks/log.rake +0 -1
- data/lib/rails/tasks/routes.rake +4 -26
- data/lib/rails/tasks/statistics.rake +4 -0
- data/lib/rails/tasks/yarn.rake +2 -3
- data/lib/rails/tasks/zeitwerk.rake +66 -0
- data/lib/rails/templates/rails/welcome/index.html.erb +2 -2
- data/lib/rails/test_help.rb +11 -9
- data/lib/rails/test_unit/reporter.rb +1 -1
- data/lib/rails/test_unit/runner.rb +5 -5
- data/lib/rails/test_unit/testing.rake +1 -1
- metadata +36 -23
- data/lib/rails/generators/js/assets/assets_generator.rb +0 -15
- data/lib/rails/generators/js/assets/templates/javascript.js +0 -2
- data/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +0 -22
- data/lib/rails/generators/rails/app/templates/bin/bundle.tt +0 -2
- data/lib/rails/generators/rails/app/templates/bin/update.tt +0 -34
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_5_2.rb.tt +0 -38
- data/lib/rails/generators/rails/assets/templates/javascript.js +0 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6d6daf9b3f1b547bf223fe3590049db5c3892515b09e449db25763393cbdf26
|
|
4
|
+
data.tar.gz: 331197625259cb0dc0f88b6c5908e764cb18aadb9da086a63495772d1c09befa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3116c14dccf11d82ae0ab6c4ef82b62eb0ab0b141139527c9a0026429605730a5221f500229b34c1cc0eced8b42aa65689ab9449aaa415327014748ec64a188e
|
|
7
|
+
data.tar.gz: 76d90b6785dead03c3311820e61cb21c6918cf5c02df7e5b80d1613c2a2cefbe97a441f9974a9ee2645c74a43b7a96ef3890f0d5584bdaf24f01e34a7cc9650e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,238 +1,457 @@
|
|
|
1
|
-
## Rails
|
|
1
|
+
## Rails 6.0.2 (December 13, 2019) ##
|
|
2
2
|
|
|
3
|
-
*
|
|
3
|
+
* Fix the collision check for the scaffold generator.
|
|
4
4
|
|
|
5
|
+
*Ryan Robeson*
|
|
5
6
|
|
|
6
|
-
## Rails
|
|
7
|
+
## Rails 6.0.1 (November 5, 2019) ##
|
|
7
8
|
|
|
8
|
-
*
|
|
9
|
+
* The `zeitwerk:check` Rake task reports files outside the app's root
|
|
10
|
+
directory, as in engines loaded from gems.
|
|
9
11
|
|
|
10
|
-
*
|
|
12
|
+
*Xavier Noria*
|
|
11
13
|
|
|
12
|
-
*
|
|
14
|
+
* Fixed a possible error when using the evented file update checker.
|
|
13
15
|
|
|
14
|
-
*
|
|
16
|
+
*Yuji Yaginuma*
|
|
15
17
|
|
|
18
|
+
* The sqlite3 database files created by the parallel testing feature are
|
|
19
|
+
included in the default `.gitignore` file for newly-generated apps.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
*Yasuo Honda*
|
|
18
22
|
|
|
19
|
-
*
|
|
23
|
+
* `rails new` generates a `.keep` file in `tmp/pids`. This fixes starting
|
|
24
|
+
a server via `rackup` instead of `rails server`.
|
|
20
25
|
|
|
26
|
+
*Rafael Mendonça França*
|
|
21
27
|
|
|
22
|
-
## Rails 5.2.1 (August 07, 2018) ##
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
## Rails 6.0.0 (August 16, 2019) ##
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
* `Rails.autoloaders.log!` is a logging shortcut to get the activity of the
|
|
32
|
+
loaders printed to standard output. May be handy for troubleshooting.
|
|
27
33
|
|
|
28
|
-
*
|
|
34
|
+
*Xavier Noria*
|
|
29
35
|
|
|
30
|
-
Skip the assets' initializer when sprockets isn't loaded.
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
## Rails 6.0.0.rc2 (July 22, 2019) ##
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
* The new configuration point `config.add_autoload_paths_to_load_path` allows
|
|
40
|
+
users to opt-out from adding autoload paths to `$LOAD_PATH`. This flag is
|
|
41
|
+
`true` by default, but it is recommended to be set to `false` in `:zeitwerk`
|
|
42
|
+
mode early, in `config/application.rb`.
|
|
35
43
|
|
|
36
|
-
|
|
44
|
+
Zeitwerk uses only absolute paths internally, and applications running in
|
|
45
|
+
`:zeitwerk` mode do not need `require_dependency`, so models, controllers,
|
|
46
|
+
jobs, etc. do not need to be in `$LOAD_PATH`. Setting this to `false` saves
|
|
47
|
+
Ruby from checking these directories when resolving `require` calls with
|
|
48
|
+
relative paths, and saves Bootsnap work and RAM, since it does not need to
|
|
49
|
+
build an index for them.
|
|
37
50
|
|
|
38
|
-
|
|
51
|
+
*Xavier Noria*
|
|
39
52
|
|
|
40
|
-
|
|
53
|
+
## Rails 6.0.0.rc1 (April 24, 2019) ##
|
|
41
54
|
|
|
42
|
-
*
|
|
55
|
+
* Applications upgrading to Rails 6 can run the command
|
|
43
56
|
|
|
44
|
-
|
|
57
|
+
```
|
|
58
|
+
bin/rails zeitwerk:check
|
|
59
|
+
```
|
|
45
60
|
|
|
46
|
-
|
|
61
|
+
to check if the project structure they were using with the classic
|
|
62
|
+
autoloader is compatible with `:zeitwerk` mode.
|
|
47
63
|
|
|
48
|
-
*
|
|
49
|
-
POSIX-compliant systems.
|
|
64
|
+
*Matilda Smeds* & *Xavier Noria*
|
|
50
65
|
|
|
51
|
-
|
|
66
|
+
* Allow loading seeds without ActiveJob.
|
|
52
67
|
|
|
53
|
-
|
|
54
|
-
-rw-r--r-- 1 owner group 32 Jan 1 00:00 master.key
|
|
68
|
+
Fixes #35782
|
|
55
69
|
|
|
56
|
-
|
|
70
|
+
*Jeremy Weathers*
|
|
57
71
|
|
|
58
|
-
|
|
59
|
-
|
|
72
|
+
* `null: false` is set in the migrations by default for column pointed by
|
|
73
|
+
`belongs_to` / `references` association generated by model generator.
|
|
60
74
|
|
|
61
|
-
|
|
75
|
+
Also deprecate passing {required} to the model generator.
|
|
62
76
|
|
|
63
|
-
*
|
|
77
|
+
*Prathamesh Sonpatki*
|
|
78
|
+
|
|
79
|
+
* New applications get `config.cache_classes = false` in `config/environments/test.rb`
|
|
80
|
+
unless `--skip-spring`.
|
|
64
81
|
|
|
65
|
-
*
|
|
82
|
+
*Xavier Noria*
|
|
66
83
|
|
|
67
|
-
|
|
84
|
+
* Autoloading during initialization is deprecated.
|
|
85
|
+
|
|
86
|
+
*Xavier Noria*
|
|
87
|
+
|
|
88
|
+
* Only force `:async` ActiveJob adapter to `:inline` during seeding.
|
|
89
|
+
|
|
90
|
+
*BatedUrGonnaDie*
|
|
91
|
+
|
|
92
|
+
* The `connection` option of `rails dbconsole` command is deprecated in
|
|
93
|
+
favor of `database` option.
|
|
68
94
|
|
|
69
95
|
*Yuji Yaginuma*
|
|
70
96
|
|
|
97
|
+
* Replace `chromedriver-helper` gem with `webdrivers` in default Gemfile.
|
|
98
|
+
`chromedriver-helper` is deprecated as of March 31, 2019 and won't
|
|
99
|
+
receive any further updates.
|
|
71
100
|
|
|
72
|
-
|
|
101
|
+
*Guillermo Iguaran*
|
|
73
102
|
|
|
74
|
-
*
|
|
103
|
+
* Applications running in `:zeitwerk` mode that use `bootsnap` need
|
|
104
|
+
to upgrade `bootsnap` to at least 1.4.2.
|
|
75
105
|
|
|
76
|
-
|
|
106
|
+
*Xavier Noria*
|
|
77
107
|
|
|
78
|
-
|
|
108
|
+
* Add `config.disable_sandbox` option to Rails console.
|
|
79
109
|
|
|
80
|
-
|
|
110
|
+
This setting will disable `rails console --sandbox` mode, preventing
|
|
111
|
+
developer from accidentally starting a sandbox console,
|
|
112
|
+
which when left inactive, can cause the database server to run out of memory.
|
|
81
113
|
|
|
82
|
-
*
|
|
114
|
+
*Prem Sichanugrist*
|
|
115
|
+
|
|
116
|
+
* Add `-e/--environment` option to `rails initializers`.
|
|
83
117
|
|
|
84
118
|
*Yuji Yaginuma*
|
|
85
119
|
|
|
86
|
-
* `rails new` and `rails plugin new` get `Active Storage` by default.
|
|
87
|
-
Add ability to skip `Active Storage` with `--skip-active-storage`
|
|
88
|
-
and do so automatically when `--skip-active-record` is used.
|
|
89
120
|
|
|
90
|
-
|
|
121
|
+
## Rails 6.0.0.beta3 (March 11, 2019) ##
|
|
91
122
|
|
|
92
|
-
*
|
|
123
|
+
* Generate random development secrets
|
|
93
124
|
|
|
94
|
-
|
|
125
|
+
A random development secret is now generated to tmp/development_secret.txt
|
|
95
126
|
|
|
96
|
-
|
|
127
|
+
This avoids an issue where development mode servers were vulnerable to
|
|
128
|
+
remote code execution.
|
|
97
129
|
|
|
98
|
-
|
|
130
|
+
Fixes CVE-2019-5420
|
|
99
131
|
|
|
100
|
-
*
|
|
132
|
+
*Eileen M. Uchitelle*, *Aaron Patterson*, *John Hawthorn*
|
|
101
133
|
|
|
102
|
-
Spares away needless secret configs.
|
|
103
134
|
|
|
104
|
-
|
|
135
|
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
|
|
105
136
|
|
|
106
|
-
*
|
|
137
|
+
* Fix non-symbol access to nested hashes returned from `Rails::Application.config_for`
|
|
138
|
+
being broken by allowing non-symbol access with a deprecation notice.
|
|
107
139
|
|
|
108
|
-
*
|
|
140
|
+
*Ufuk Kayserilioglu*
|
|
109
141
|
|
|
110
|
-
*
|
|
142
|
+
* Fix deeply nested namespace command printing.
|
|
111
143
|
|
|
112
|
-
*
|
|
144
|
+
*Gannon McGibbon*
|
|
113
145
|
|
|
114
|
-
* Optimize routes indentation.
|
|
115
146
|
|
|
116
|
-
|
|
147
|
+
## Rails 6.0.0.beta1 (January 18, 2019) ##
|
|
117
148
|
|
|
118
|
-
*
|
|
149
|
+
* Remove deprecated `after_bundle` helper inside plugins templates.
|
|
119
150
|
|
|
120
|
-
*
|
|
151
|
+
*Rafael Mendonça França*
|
|
121
152
|
|
|
122
|
-
*
|
|
153
|
+
* Remove deprecated support to old `config.ru` that use the application class as argument of `run`.
|
|
123
154
|
|
|
124
|
-
*
|
|
155
|
+
*Rafael Mendonça França*
|
|
125
156
|
|
|
126
|
-
*
|
|
157
|
+
* Remove deprecated `environment` argument from the rails commands.
|
|
127
158
|
|
|
128
|
-
*
|
|
159
|
+
*Rafael Mendonça França*
|
|
129
160
|
|
|
130
|
-
*
|
|
161
|
+
* Remove deprecated `capify!`.
|
|
131
162
|
|
|
132
|
-
*
|
|
163
|
+
*Rafael Mendonça França*
|
|
133
164
|
|
|
134
|
-
*
|
|
165
|
+
* Remove deprecated `config.secret_token`.
|
|
135
166
|
|
|
136
|
-
*
|
|
167
|
+
*Rafael Mendonça França*
|
|
137
168
|
|
|
138
|
-
*
|
|
139
|
-
root file containing the current Ruby version when new Rails applications are
|
|
140
|
-
created.
|
|
169
|
+
* Seed database with inline ActiveJob job adapter.
|
|
141
170
|
|
|
142
|
-
*
|
|
171
|
+
*Gannon McGibbon*
|
|
143
172
|
|
|
144
|
-
*
|
|
145
|
-
`rails runner`
|
|
173
|
+
* Add `rails db:system:change` command for changing databases.
|
|
146
174
|
|
|
147
|
-
|
|
175
|
+
```
|
|
176
|
+
bin/rails db:system:change --to=postgresql
|
|
177
|
+
force config/database.yml
|
|
178
|
+
gsub Gemfile
|
|
179
|
+
```
|
|
148
180
|
|
|
149
|
-
|
|
181
|
+
The change command copies a template `config/database.yml` with
|
|
182
|
+
the target database adapter into your app, and replaces your database gem
|
|
183
|
+
with the target database gem.
|
|
150
184
|
|
|
151
|
-
*
|
|
185
|
+
*Gannon McGibbon*
|
|
152
186
|
|
|
153
|
-
*
|
|
154
|
-
and `dbconsole` commands.
|
|
187
|
+
* Add `rails test:channels`.
|
|
155
188
|
|
|
156
|
-
*
|
|
189
|
+
*bogdanvlviv*
|
|
157
190
|
|
|
158
|
-
*
|
|
159
|
-
`rails dbconsole` and `rails console` commands is deprecated.
|
|
160
|
-
The `-e` option should be used instead.
|
|
191
|
+
* Use original `bundler` environment variables during the process of generating a new rails project.
|
|
161
192
|
|
|
162
|
-
|
|
193
|
+
*Marco Costa*
|
|
163
194
|
|
|
164
|
-
|
|
195
|
+
* Send Active Storage analysis and purge jobs to dedicated queues by default.
|
|
165
196
|
|
|
166
|
-
|
|
197
|
+
Analysis jobs now use the `:active_storage_analysis` queue, and purge jobs
|
|
198
|
+
now use the `:active_storage_purge` queue. This matches Action Mailbox,
|
|
199
|
+
which sends its jobs to dedicated queues by default.
|
|
167
200
|
|
|
168
|
-
|
|
201
|
+
*George Claghorn*
|
|
169
202
|
|
|
170
|
-
|
|
203
|
+
* Add `rails test:mailboxes`.
|
|
171
204
|
|
|
172
|
-
*
|
|
173
|
-
command when using a 3-level database configuration.
|
|
205
|
+
*George Claghorn*
|
|
174
206
|
|
|
175
|
-
|
|
207
|
+
* Introduce guard against DNS rebinding attacks.
|
|
176
208
|
|
|
177
|
-
|
|
209
|
+
The `ActionDispatch::HostAuthorization` is a new middleware that prevents
|
|
210
|
+
against DNS rebinding and other `Host` header attacks. It is included in
|
|
211
|
+
the development environment by default with the following configuration:
|
|
178
212
|
|
|
179
|
-
|
|
213
|
+
Rails.application.config.hosts = [
|
|
214
|
+
IPAddr.new("0.0.0.0/0"), # All IPv4 addresses.
|
|
215
|
+
IPAddr.new("::/0"), # All IPv6 addresses.
|
|
216
|
+
"localhost" # The localhost reserved domain.
|
|
217
|
+
]
|
|
180
218
|
|
|
181
|
-
|
|
182
|
-
|
|
219
|
+
In other environments `Rails.application.config.hosts` is empty and no
|
|
220
|
+
`Host` header checks will be done. If you want to guard against header
|
|
221
|
+
attacks on production, you have to manually permit the allowed hosts
|
|
222
|
+
with:
|
|
183
223
|
|
|
184
|
-
|
|
224
|
+
Rails.application.config.hosts << "product.com"
|
|
185
225
|
|
|
186
|
-
|
|
226
|
+
The host of a request is checked against the `hosts` entries with the case
|
|
227
|
+
operator (`#===`), which lets `hosts` support entries of type `Regexp`,
|
|
228
|
+
`Proc` and `IPAddr` to name a few. Here is an example with a regexp.
|
|
187
229
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
230
|
+
# Allow requests from subdomains like `www.product.com` and
|
|
231
|
+
# `beta1.product.com`.
|
|
232
|
+
Rails.application.config.hosts << /.*\.product\.com/
|
|
191
233
|
|
|
192
|
-
|
|
234
|
+
A special case is supported that allows you to permit all sub-domains:
|
|
193
235
|
|
|
194
|
-
|
|
236
|
+
# Allow requests from subdomains like `www.product.com` and
|
|
237
|
+
# `beta1.product.com`.
|
|
238
|
+
Rails.application.config.hosts << ".product.com"
|
|
195
239
|
|
|
196
|
-
|
|
240
|
+
*Genadi Samokovarov*
|
|
197
241
|
|
|
198
|
-
|
|
242
|
+
* Remove redundant suffixes on generated helpers.
|
|
199
243
|
|
|
200
|
-
*
|
|
244
|
+
*Gannon McGibbon*
|
|
201
245
|
|
|
202
|
-
|
|
246
|
+
* Remove redundant suffixes on generated integration tests.
|
|
247
|
+
|
|
248
|
+
*Gannon McGibbon*
|
|
249
|
+
|
|
250
|
+
* Fix boolean interaction in scaffold system tests.
|
|
203
251
|
|
|
204
|
-
*
|
|
252
|
+
*Gannon McGibbon*
|
|
205
253
|
|
|
206
|
-
|
|
254
|
+
* Remove redundant suffixes on generated system tests.
|
|
255
|
+
|
|
256
|
+
*Gannon McGibbon*
|
|
257
|
+
|
|
258
|
+
* Add an `abort_on_failure` boolean option to the generator method that shell
|
|
259
|
+
out (`generate`, `rake`, `rails_command`) to abort the generator if the
|
|
260
|
+
command fails.
|
|
207
261
|
|
|
208
262
|
*David Rodríguez*
|
|
209
263
|
|
|
210
|
-
*
|
|
264
|
+
* Remove `app/assets` and `app/javascript` from `eager_load_paths` and `autoload_paths`.
|
|
265
|
+
|
|
266
|
+
*Gannon McGibbon*
|
|
267
|
+
|
|
268
|
+
* Use Ids instead of memory addresses when displaying references in scaffold views.
|
|
269
|
+
|
|
270
|
+
Fixes #29200.
|
|
271
|
+
|
|
272
|
+
*Rasesh Patel*
|
|
273
|
+
|
|
274
|
+
* Adds support for multiple databases to `rails db:migrate:status`.
|
|
275
|
+
Subtasks are also added to get the status of individual databases (eg. `rails db:migrate:status:animals`).
|
|
276
|
+
|
|
277
|
+
*Gannon McGibbon*
|
|
278
|
+
|
|
279
|
+
* Use Webpacker by default to manage app-level JavaScript through the new app/javascript directory.
|
|
280
|
+
Sprockets is now solely in charge, by default, of compiling CSS and other static assets.
|
|
281
|
+
Action Cable channel generators will create ES6 stubs rather than use CoffeeScript.
|
|
282
|
+
Active Storage, Action Cable, Turbolinks, and Rails-UJS are loaded by a new application.js pack.
|
|
283
|
+
Generators no longer generate JavaScript stubs.
|
|
284
|
+
|
|
285
|
+
*DHH*, *Lachlan Sylvester*
|
|
286
|
+
|
|
287
|
+
* Add `database` (aliased as `db`) option to model generator to allow
|
|
288
|
+
setting the database. This is useful for applications that use
|
|
289
|
+
multiple databases and put migrations per database in their own directories.
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
bin/rails g model Room capacity:integer --database=kingston
|
|
293
|
+
invoke active_record
|
|
294
|
+
create db/kingston_migrate/20180830151055_create_rooms.rb
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Because rails scaffolding uses the model generator, you can
|
|
298
|
+
also specify a database with the scaffold generator.
|
|
299
|
+
|
|
300
|
+
*Gannon McGibbon*
|
|
301
|
+
|
|
302
|
+
* Raise an error when "recyclable cache keys" are being used by a cache store
|
|
303
|
+
that does not explicitly support it. Custom cache keys that do support this feature
|
|
304
|
+
can bypass this error by implementing the `supports_cache_versioning?` method on their
|
|
305
|
+
class and returning a truthy value.
|
|
306
|
+
|
|
307
|
+
*Richard Schneeman*
|
|
308
|
+
|
|
309
|
+
* Support environment specific credentials overrides.
|
|
310
|
+
|
|
311
|
+
So any environment will look for `config/credentials/#{Rails.env}.yml.enc` and fall back
|
|
312
|
+
to `config/credentials.yml.enc`.
|
|
313
|
+
|
|
314
|
+
The encryption key can be in `ENV["RAILS_MASTER_KEY"]` or `config/credentials/production.key`.
|
|
315
|
+
|
|
316
|
+
Environment credentials overrides can be edited with `rails credentials:edit --environment production`.
|
|
317
|
+
If no override is set up for the passed environment, it will be created.
|
|
318
|
+
|
|
319
|
+
Additionally, the default lookup paths can be overwritten with these configs:
|
|
320
|
+
|
|
321
|
+
- `config.credentials.content_path`
|
|
322
|
+
- `config.credentials.key_path`
|
|
323
|
+
|
|
324
|
+
*Wojciech Wnętrzak*
|
|
325
|
+
|
|
326
|
+
* Make `ActiveSupport::Cache::NullStore` the default cache store in the test environment.
|
|
327
|
+
|
|
328
|
+
*Michael C. Nelson*
|
|
329
|
+
|
|
330
|
+
* Emit warning for unknown inflection rule when generating model.
|
|
331
|
+
|
|
332
|
+
*Yoshiyuki Kinjo*
|
|
333
|
+
|
|
334
|
+
* Add `database` (aliased as `db`) option to migration generator.
|
|
335
|
+
|
|
336
|
+
If you're using multiple databases and have a folder for each database
|
|
337
|
+
for migrations (ex db/migrate and db/new_db_migrate) you can now pass the
|
|
338
|
+
`--database` option to the generator to make sure the the migration
|
|
339
|
+
is inserted into the correct folder.
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
rails g migration CreateHouses --database=kingston
|
|
343
|
+
invoke active_record
|
|
344
|
+
create db/kingston_migrate/20180830151055_create_houses.rb
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
*Eileen M. Uchitelle*
|
|
348
|
+
|
|
349
|
+
* Deprecate `rake routes` in favor of `rails routes`.
|
|
211
350
|
|
|
212
351
|
*Yuji Yaginuma*
|
|
213
352
|
|
|
214
|
-
*
|
|
353
|
+
* Deprecate `rake initializers` in favor of `rails initializers`.
|
|
354
|
+
|
|
355
|
+
*Annie-Claude Côté*
|
|
356
|
+
|
|
357
|
+
* Deprecate `rake dev:cache` in favor of `rails dev:cache`.
|
|
358
|
+
|
|
359
|
+
*Annie-Claude Côté*
|
|
360
|
+
|
|
361
|
+
* Deprecate `rails notes` subcommands in favor of passing an `annotations` argument to `rails notes`.
|
|
362
|
+
|
|
363
|
+
The following subcommands are replaced by passing `--annotations` or `-a` to `rails notes`:
|
|
364
|
+
- `rails notes:custom ANNOTATION=custom` is deprecated in favor of using `rails notes -a custom`.
|
|
365
|
+
- `rails notes:optimize` is deprecated in favor of using `rails notes -a OPTIMIZE`.
|
|
366
|
+
- `rails notes:todo` is deprecated in favor of using`rails notes -a TODO`.
|
|
367
|
+
- `rails notes:fixme` is deprecated in favor of using `rails notes -a FIXME`.
|
|
368
|
+
|
|
369
|
+
*Annie-Claude Côté*
|
|
370
|
+
|
|
371
|
+
* Deprecate `SOURCE_ANNOTATION_DIRECTORIES` environment variable used by `rails notes`
|
|
372
|
+
through `Rails::SourceAnnotationExtractor::Annotation` in favor of using `config.annotations.register_directories`.
|
|
373
|
+
|
|
374
|
+
*Annie-Claude Côté*
|
|
375
|
+
|
|
376
|
+
* Deprecate `rake notes` in favor of `rails notes`.
|
|
377
|
+
|
|
378
|
+
*Annie-Claude Côté*
|
|
379
|
+
|
|
380
|
+
* Don't generate unused files in `app:update` task.
|
|
381
|
+
|
|
382
|
+
Skip the assets' initializer when sprockets isn't loaded.
|
|
383
|
+
|
|
384
|
+
Skip `config/spring.rb` when spring isn't loaded.
|
|
385
|
+
|
|
386
|
+
Skip yarn's contents when yarn integration isn't used.
|
|
215
387
|
|
|
216
388
|
*Tsukuru Tanimichi*
|
|
217
389
|
|
|
218
|
-
*
|
|
390
|
+
* Make the master.key file read-only for the owner upon generation on
|
|
391
|
+
POSIX-compliant systems.
|
|
392
|
+
|
|
393
|
+
Previously:
|
|
219
394
|
|
|
220
|
-
|
|
395
|
+
$ ls -l config/master.key
|
|
396
|
+
-rw-r--r-- 1 owner group 32 Jan 1 00:00 master.key
|
|
397
|
+
|
|
398
|
+
Now:
|
|
399
|
+
|
|
400
|
+
$ ls -l config/master.key
|
|
401
|
+
-rw------- 1 owner group 32 Jan 1 00:00 master.key
|
|
402
|
+
|
|
403
|
+
Fixes #32604.
|
|
404
|
+
|
|
405
|
+
*Jose Luis Duran*
|
|
406
|
+
|
|
407
|
+
* Deprecate support for using the `HOST` environment variable to specify the server IP.
|
|
221
408
|
|
|
222
|
-
|
|
409
|
+
The `BINDING` environment variable should be used instead.
|
|
223
410
|
|
|
224
|
-
Fixes #
|
|
411
|
+
Fixes #29516.
|
|
225
412
|
|
|
226
413
|
*Yuji Yaginuma*
|
|
227
414
|
|
|
228
|
-
*
|
|
415
|
+
* Deprecate passing Rack server name as a regular argument to `rails server`.
|
|
416
|
+
|
|
417
|
+
Previously:
|
|
418
|
+
|
|
419
|
+
$ bin/rails server thin
|
|
420
|
+
|
|
421
|
+
There wasn't an explicit option for the Rack server to use, now we have the
|
|
422
|
+
`--using` option with the `-u` short switch.
|
|
423
|
+
|
|
424
|
+
Now:
|
|
425
|
+
|
|
426
|
+
$ bin/rails server -u thin
|
|
427
|
+
|
|
428
|
+
This change also improves the error message if a missing or mistyped rack
|
|
429
|
+
server is given.
|
|
430
|
+
|
|
431
|
+
*Genadi Samokovarov*
|
|
432
|
+
|
|
433
|
+
* Add "rails routes --expanded" option to output routes in expanded mode like
|
|
434
|
+
"psql --expanded". Result looks like:
|
|
435
|
+
|
|
436
|
+
```
|
|
437
|
+
$ rails routes --expanded
|
|
438
|
+
--[ Route 1 ]------------------------------------------------------------
|
|
439
|
+
Prefix | high_scores
|
|
440
|
+
Verb | GET
|
|
441
|
+
URI | /high_scores(.:format)
|
|
442
|
+
Controller#Action | high_scores#index
|
|
443
|
+
--[ Route 2 ]------------------------------------------------------------
|
|
444
|
+
Prefix | new_high_score
|
|
445
|
+
Verb | GET
|
|
446
|
+
URI | /high_scores/new(.:format)
|
|
447
|
+
Controller#Action | high_scores#new
|
|
448
|
+
```
|
|
229
449
|
|
|
230
|
-
*
|
|
450
|
+
*Benoit Tigeot*
|
|
231
451
|
|
|
232
|
-
*
|
|
233
|
-
when using Turbolinks.
|
|
452
|
+
* Rails 6 requires Ruby 2.5.0 or newer.
|
|
234
453
|
|
|
235
|
-
*
|
|
454
|
+
*Jeremy Daer*, *Kasper Timm Hansen*
|
|
236
455
|
|
|
237
456
|
|
|
238
|
-
Please check [5-
|
|
457
|
+
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/railties/CHANGELOG.md) for previous changes.
|