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