railties 5.2.8.1 → 6.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of railties might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +182 -223
- data/MIT-LICENSE +1 -1
- data/RDOC_MAIN.rdoc +35 -28
- data/README.rdoc +1 -1
- data/lib/minitest/rails_plugin.rb +6 -10
- 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 +1 -1
- data/lib/rails/app_updater.rb +3 -1
- data/lib/rails/application/configuration.rb +54 -12
- data/lib/rails/application/default_middleware_stack.rb +2 -0
- data/lib/rails/application.rb +21 -45
- data/lib/rails/backtrace_cleaner.rb +5 -17
- data/lib/rails/code_statistics.rb +3 -3
- data/lib/rails/command/actions.rb +0 -10
- data/lib/rails/command/base.rb +1 -5
- data/lib/rails/command/behavior.rb +4 -46
- data/lib/rails/command/environment_argument.rb +1 -11
- data/lib/rails/command/spellchecker.rb +58 -0
- data/lib/rails/command.rb +11 -10
- data/lib/rails/commands/credentials/USAGE +19 -1
- data/lib/rails/commands/credentials/credentials_command.rb +42 -23
- data/lib/rails/commands/db/system/change/change_command.rb +20 -0
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +2 -2
- data/lib/rails/commands/dev/dev_command.rb +17 -0
- data/lib/rails/commands/encrypted/encrypted_command.rb +2 -3
- data/lib/rails/commands/help/help_command.rb +1 -1
- data/lib/rails/commands/initializers/initializers_command.rb +16 -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 +6 -6
- 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 +109 -48
- data/lib/rails/configuration.rb +1 -7
- data/lib/rails/engine/configuration.rb +3 -1
- data/lib/rails/engine.rb +3 -9
- data/lib/rails/gem_version.rb +4 -4
- data/lib/rails/generators/actions.rb +48 -37
- data/lib/rails/generators/app_base.rb +49 -89
- data/lib/rails/generators/app_name.rb +50 -0
- data/lib/rails/generators/base.rb +0 -4
- data/lib/rails/generators/database.rb +57 -0
- data/lib/rails/generators/erb/mailer/mailer_generator.rb +1 -1
- data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +1 -1
- data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +1 -1
- data/lib/rails/generators/generated_attribute.rb +17 -17
- 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 +3 -6
- 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 +15 -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 +4 -5
- data/lib/rails/generators/rails/app/templates/bin/update.tt +6 -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/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/sqlserver.yml.tt +2 -2
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +3 -2
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +5 -12
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +6 -2
- 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 +4 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +33 -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 +3 -5
- 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/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 -8
- 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 +55 -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 -18
- 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/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/scaffold/scaffold_generator.rb +1 -1
- data/lib/rails/generators/test_unit/system/system_generator.rb +5 -0
- data/lib/rails/generators/testing/behaviour.rb +3 -0
- data/lib/rails/generators.rb +11 -12
- data/lib/rails/info.rb +2 -2
- data/lib/rails/info_controller.rb +1 -1
- data/lib/rails/mailers_controller.rb +1 -1
- 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 +125 -117
- 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 +1 -0
- data/lib/rails/tasks/yarn.rake +1 -1
- 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 +33 -27
- data/lib/rails/commands/encrypted/USAGE +0 -28
- 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/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: 66f8f350ddf521a8fb2a51bddda33e6afc57c6e239ea0fe8bd23bea476d12c8f
|
4
|
+
data.tar.gz: e647293ffdbc4bbc4beddbde230d567e90de69183b5498729717f1bfda0b2890
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f62d369e32f4e40ef7d5f08af230bc70967627c5db1f68c4ab295c7942ac152f33af09bb1012a2d239fb260f411328d3cf78daf70e6d08329079b031ed2f453c
|
7
|
+
data.tar.gz: 786ff80d0075f5ff9adefe82ce44c249aa436c8a62f663c2c10d62bef204b84ed9b1a743b7866314756eb3ea86172f3468822736d01333d0cd04cd224fc1a46d
|
data/CHANGELOG.md
CHANGED
@@ -1,161 +1,243 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 6.0.0.beta1 (January 18, 2019) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* Remove deprecated `after_bundle` helper inside plugins templates.
|
4
4
|
|
5
|
+
*Rafael Mendonça França*
|
5
6
|
|
6
|
-
|
7
|
+
* Remove deprecated support to old `config.ru` that use the application class as argument of `run`.
|
7
8
|
|
8
|
-
*
|
9
|
+
*Rafael Mendonça França*
|
9
10
|
|
11
|
+
* Remove deprecated `environment` argument from the rails commands.
|
10
12
|
|
11
|
-
|
13
|
+
*Rafael Mendonça França*
|
12
14
|
|
13
|
-
*
|
15
|
+
* Remove deprecated `capify!`.
|
14
16
|
|
17
|
+
*Rafael Mendonça França*
|
15
18
|
|
16
|
-
|
19
|
+
* Remove deprecated `config.secret_token`.
|
17
20
|
|
18
|
-
*
|
21
|
+
*Rafael Mendonça França*
|
19
22
|
|
23
|
+
* Seed database with inline ActiveJob job adapter.
|
20
24
|
|
21
|
-
|
25
|
+
*Gannon McGibbon*
|
22
26
|
|
23
|
-
*
|
27
|
+
* Add `rails db:system:change` command for changing databases.
|
24
28
|
|
29
|
+
```
|
30
|
+
bin/rails db:system:change --to=postgresql
|
31
|
+
force config/database.yml
|
32
|
+
gsub Gemfile
|
33
|
+
```
|
25
34
|
|
26
|
-
|
35
|
+
The change command copies a template `config/database.yml` with the target database adapter into your app, and replaces your database gem with the target database gem.
|
27
36
|
|
28
|
-
*
|
37
|
+
*Gannon McGibbon*
|
29
38
|
|
39
|
+
* Add `rails test:channels`.
|
30
40
|
|
31
|
-
|
41
|
+
*bogdanvlviv*
|
32
42
|
|
33
|
-
*
|
43
|
+
* Use original `bundler` environment variables during the process of generating a new rails project.
|
34
44
|
|
45
|
+
*Marco Costa*
|
35
46
|
|
36
|
-
|
47
|
+
* Send Active Storage analysis and purge jobs to dedicated queues by default.
|
37
48
|
|
38
|
-
|
49
|
+
Analysis jobs now use the `:active_storage_analysis` queue, and purge jobs
|
50
|
+
now use the `:active_storage_purge` queue. This matches Action Mailbox,
|
51
|
+
which sends its jobs to dedicated queues by default.
|
39
52
|
|
53
|
+
*George Claghorn*
|
40
54
|
|
41
|
-
|
55
|
+
* Add `rails test:mailboxes`.
|
42
56
|
|
43
|
-
*
|
57
|
+
*George Claghorn*
|
44
58
|
|
59
|
+
* Introduce guard against DNS rebinding attacks
|
45
60
|
|
46
|
-
|
61
|
+
The `ActionDispatch::HostAuthorization` is a new middleware that prevent
|
62
|
+
against DNS rebinding and other `Host` header attacks. It is included in
|
63
|
+
the development environment by default with the following configuration:
|
47
64
|
|
48
|
-
|
65
|
+
Rails.application.config.hosts = [
|
66
|
+
IPAddr.new("0.0.0.0/0"), # All IPv4 addresses.
|
67
|
+
IPAddr.new("::/0"), # All IPv6 addresses.
|
68
|
+
"localhost" # The localhost reserved domain.
|
69
|
+
]
|
49
70
|
|
71
|
+
In other environments `Rails.application.config.hosts` is empty and no
|
72
|
+
`Host` header checks will be done. If you want to guard against header
|
73
|
+
attacks on production, you have to manually whitelist the allowed hosts
|
74
|
+
with:
|
50
75
|
|
51
|
-
|
76
|
+
Rails.application.config.hosts << "product.com"
|
52
77
|
|
53
|
-
|
78
|
+
The host of a request is checked against the `hosts` entries with the case
|
79
|
+
operator (`#===`), which lets `hosts` support entries of type `RegExp`,
|
80
|
+
`Proc` and `IPAddr` to name a few. Here is an example with a regexp.
|
54
81
|
|
82
|
+
# Allow requests from subdomains like `www.product.com` and
|
83
|
+
# `beta1.product.com`.
|
84
|
+
Rails.application.config.hosts << /.*\.product\.com/
|
55
85
|
|
56
|
-
|
86
|
+
A special case is supported that allows you to whitelist all sub-domains:
|
57
87
|
|
58
|
-
|
88
|
+
# Allow requests from subdomains like `www.product.com` and
|
89
|
+
# `beta1.product.com`.
|
90
|
+
Rails.application.config.hosts << ".product.com"
|
59
91
|
|
92
|
+
*Genadi Samokovarov*
|
60
93
|
|
61
|
-
|
94
|
+
* Remove redundant suffixes on generated helpers.
|
62
95
|
|
63
|
-
*
|
96
|
+
*Gannon McGibbon*
|
64
97
|
|
98
|
+
* Remove redundant suffixes on generated integration tests.
|
65
99
|
|
66
|
-
|
100
|
+
*Gannon McGibbon*
|
67
101
|
|
68
|
-
*
|
102
|
+
* Fix boolean interaction in scaffold system tests.
|
69
103
|
|
104
|
+
*Gannon McGibbon*
|
70
105
|
|
71
|
-
|
106
|
+
* Remove redundant suffixes on generated system tests.
|
72
107
|
|
73
|
-
*
|
108
|
+
*Gannon McGibbon*
|
74
109
|
|
110
|
+
* Add an `abort_on_failure` boolean option to the generator method that shell
|
111
|
+
out (`generate`, `rake`, `rails_command`) to abort the generator if the
|
112
|
+
command fails.
|
75
113
|
|
76
|
-
|
114
|
+
*David Rodríguez*
|
77
115
|
|
78
|
-
*
|
116
|
+
* Remove `app/assets` and `app/javascript` from `eager_load_paths` and `autoload_paths`.
|
79
117
|
|
80
|
-
*
|
118
|
+
*Gannon McGibbon*
|
81
119
|
|
82
|
-
*
|
120
|
+
* Use Ids instead of memory addresses when displaying references in scaffold views.
|
83
121
|
|
84
|
-
Fixes #
|
122
|
+
Fixes #29200.
|
85
123
|
|
86
|
-
*
|
124
|
+
*Rasesh Patel*
|
87
125
|
|
88
|
-
*
|
126
|
+
* Adds support for multiple databases to `rails db:migrate:status`.
|
127
|
+
Subtasks are also added to get the status of individual databases (eg. `rails db:migrate:status:animals`).
|
89
128
|
|
90
|
-
*
|
129
|
+
*Gannon McGibbon*
|
91
130
|
|
131
|
+
* Use Webpacker by default to manage app-level JavaScript through the new app/javascript directory.
|
132
|
+
Sprockets is now solely in charge, by default, of compiling CSS and other static assets.
|
133
|
+
Action Cable channel generators will create ES6 stubs rather than use CoffeeScript.
|
134
|
+
Active Storage, Action Cable, Turbolinks, and Rails-UJS are loaded by a new application.js pack.
|
135
|
+
Generators no longer generate JavaScript stubs.
|
92
136
|
|
93
|
-
|
137
|
+
*DHH*, *Lachlan Sylvester*
|
94
138
|
|
95
|
-
*
|
139
|
+
* Add `database` (aliased as `db`) option to model generator to allow
|
140
|
+
setting the database. This is useful for applications that use
|
141
|
+
multiple databases and put migrations per database in their own directories.
|
96
142
|
|
97
|
-
|
143
|
+
```
|
144
|
+
bin/rails g model Room capacity:integer --database=kingston
|
145
|
+
invoke active_record
|
146
|
+
create db/kingston_migrate/20180830151055_create_rooms.rb
|
147
|
+
```
|
98
148
|
|
99
|
-
|
149
|
+
Because rails scaffolding uses the model generator, you can
|
150
|
+
also specify a database with the scaffold generator.
|
100
151
|
|
101
152
|
*Gannon McGibbon*
|
102
153
|
|
154
|
+
* Raise an error when "recyclable cache keys" are being used by a cache store
|
155
|
+
that does not explicitly support it. Custom cache keys that do support this feature
|
156
|
+
can bypass this error by implementing the `supports_cache_versioning?` method on their
|
157
|
+
class and returning a truthy value.
|
103
158
|
|
104
|
-
|
159
|
+
*Richard Schneeman*
|
105
160
|
|
106
|
-
*
|
161
|
+
* Support environment specific credentials overrides.
|
107
162
|
|
108
|
-
|
163
|
+
So any environment will look for `config/credentials/#{Rails.env}.yml.enc` and fall back
|
164
|
+
to `config/credentials.yml.enc`.
|
109
165
|
|
110
|
-
|
111
|
-
remote code execution.
|
166
|
+
The encryption key can be in `ENV["RAILS_MASTER_KEY"]` or `config/credentials/production.key`.
|
112
167
|
|
113
|
-
|
168
|
+
Environment credentials overrides can be edited with `rails credentials:edit --environment production`.
|
169
|
+
If no override is setup for the passed environment, it will be created.
|
114
170
|
|
115
|
-
|
171
|
+
Additionally, the default lookup paths can be overwritten with these configs:
|
116
172
|
|
173
|
+
- `config.credentials.content_path`
|
174
|
+
- `config.credentials.key_path`
|
117
175
|
|
118
|
-
|
176
|
+
*Wojciech Wnętrzak*
|
119
177
|
|
120
|
-
*
|
178
|
+
* Make `ActiveSupport::Cache::NullStore` the default cache store in the test environment.
|
121
179
|
|
122
|
-
*
|
180
|
+
*Michael C. Nelson*
|
123
181
|
|
124
|
-
*
|
182
|
+
* Emit warning for unknown inflection rule when generating model.
|
125
183
|
|
126
|
-
*
|
184
|
+
*Yoshiyuki Kinjo*
|
127
185
|
|
186
|
+
* Add `database` (aliased as `db`) option to migration generator.
|
128
187
|
|
129
|
-
|
188
|
+
If you're using multiple databases and have a folder for each database
|
189
|
+
for migrations (ex db/migrate and db/new_db_migrate) you can now pass the
|
190
|
+
`--database` option to the generator to make sure the the migration
|
191
|
+
is inserted into the correct folder.
|
130
192
|
|
131
|
-
|
193
|
+
```
|
194
|
+
rails g migration CreateHouses --database=kingston
|
195
|
+
invoke active_record
|
196
|
+
create db/kingston_migrate/20180830151055_create_houses.rb
|
197
|
+
```
|
132
198
|
|
199
|
+
*Eileen M. Uchitelle*
|
133
200
|
|
134
|
-
|
201
|
+
* Deprecate `rake routes` in favor of `rails routes`.
|
135
202
|
|
136
|
-
*
|
203
|
+
*Yuji Yaginuma*
|
137
204
|
|
138
|
-
|
205
|
+
* Deprecate `rake initializers` in favor of `rails initializers`.
|
139
206
|
|
140
|
-
*
|
207
|
+
*Annie-Claude Côté*
|
141
208
|
|
142
|
-
|
209
|
+
* Deprecate `rake dev:cache` in favor of `rails dev:cache`.
|
143
210
|
|
144
|
-
|
211
|
+
*Annie-Claude Côté*
|
145
212
|
|
146
|
-
|
213
|
+
* Deprecate `rails notes` subcommands in favor of passing an `annotations` argument to `rails notes`.
|
147
214
|
|
148
|
-
|
215
|
+
The following subcommands are replaced by passing `--annotations` or `-a` to `rails notes`:
|
216
|
+
- `rails notes:custom ANNOTATION=custom` is deprecated in favor of using `rails notes -a custom`.
|
217
|
+
- `rails notes:optimize` is deprecated in favor of using `rails notes -a OPTIMIZE`.
|
218
|
+
- `rails notes:todo` is deprecated in favor of using`rails notes -a TODO`.
|
219
|
+
- `rails notes:fixme` is deprecated in favor of using `rails notes -a FIXME`.
|
149
220
|
|
150
|
-
|
221
|
+
*Annie-Claude Côté*
|
151
222
|
|
152
|
-
|
223
|
+
* Deprecate `SOURCE_ANNOTATION_DIRECTORIES` environment variable used by `rails notes`
|
224
|
+
through `Rails::SourceAnnotationExtractor::Annotation` in favor of using `config.annotations.register_directories`.
|
153
225
|
|
154
|
-
*
|
226
|
+
*Annie-Claude Côté*
|
155
227
|
|
156
|
-
|
228
|
+
* Deprecate `rake notes` in favor of `rails notes`.
|
157
229
|
|
158
|
-
*
|
230
|
+
*Annie-Claude Côté*
|
231
|
+
|
232
|
+
* Don't generate unused files in `app:update` task.
|
233
|
+
|
234
|
+
Skip the assets' initializer when sprockets isn't loaded.
|
235
|
+
|
236
|
+
Skip `config/spring.rb` when spring isn't loaded.
|
237
|
+
|
238
|
+
Skip yarn's contents when yarn integration isn't used.
|
239
|
+
|
240
|
+
*Tsukuru Tanimichi*
|
159
241
|
|
160
242
|
* Make the master.key file read-only for the owner upon generation on
|
161
243
|
POSIX-compliant systems.
|
@@ -174,177 +256,54 @@
|
|
174
256
|
|
175
257
|
*Jose Luis Duran*
|
176
258
|
|
177
|
-
*
|
259
|
+
* Deprecate support for using the `HOST` environment to specify the server IP.
|
178
260
|
|
179
|
-
|
261
|
+
The `BINDING` environment should be used instead.
|
180
262
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
## Rails 5.2.0 (April 09, 2018) ##
|
185
|
-
|
186
|
-
* Fix minitest rails plugin.
|
187
|
-
|
188
|
-
The custom reporters are added only if needed.
|
189
|
-
|
190
|
-
This will fix conflicts with others plugins.
|
191
|
-
|
192
|
-
*Kevin Robatel*
|
193
|
-
|
194
|
-
* Deprecate `after_bundle` callback in Rails plugin templates.
|
263
|
+
Fixes #29516.
|
195
264
|
|
196
265
|
*Yuji Yaginuma*
|
197
266
|
|
198
|
-
*
|
199
|
-
Add ability to skip `Active Storage` with `--skip-active-storage`
|
200
|
-
and do so automatically when `--skip-active-record` is used.
|
201
|
-
|
202
|
-
*bogdanvlviv*
|
203
|
-
|
204
|
-
* Gemfile for new apps: upgrade redis-rb from ~> 3.0 to 4.0.
|
205
|
-
|
206
|
-
*Jeremy Daer*
|
207
|
-
|
208
|
-
* Add `mini_magick` to default `Gemfile` as comment.
|
209
|
-
|
210
|
-
*Yoshiyuki Hirano*
|
211
|
-
|
212
|
-
* Derive `secret_key_base` from the app name in development and test environments.
|
213
|
-
|
214
|
-
Spares away needless secret configs.
|
215
|
-
|
216
|
-
*DHH*, *Kasper Timm Hansen*
|
217
|
-
|
218
|
-
* Support multiple versions arguments for `gem` method of Generators.
|
219
|
-
|
220
|
-
*Yoshiyuki Hirano*
|
221
|
-
|
222
|
-
* Add `--skip-yarn` option to the plugin generator.
|
223
|
-
|
224
|
-
*bogdanvlviv*
|
225
|
-
|
226
|
-
* Optimize routes indentation.
|
227
|
-
|
228
|
-
*Yoshiyuki Hirano*
|
229
|
-
|
230
|
-
* Optimize indentation for generator actions.
|
231
|
-
|
232
|
-
*Yoshiyuki Hirano*
|
233
|
-
|
234
|
-
* Skip unused components when running `bin/rails` in Rails plugin.
|
235
|
-
|
236
|
-
*Yoshiyuki Hirano*
|
237
|
-
|
238
|
-
* Add `git_source` to `Gemfile` for plugin generator.
|
239
|
-
|
240
|
-
*Yoshiyuki Hirano*
|
241
|
-
|
242
|
-
* Add `--skip-action-cable` option to the plugin generator.
|
243
|
-
|
244
|
-
*bogdanvlviv*
|
245
|
-
|
246
|
-
* Deprecate support for using a `Rails::Application` subclass to start Rails server.
|
247
|
-
|
248
|
-
*Yuji Yaginuma*
|
249
|
-
|
250
|
-
* Add `ruby x.x.x` version to `Gemfile` and create `.ruby-version`
|
251
|
-
root file containing the current Ruby version when new Rails applications are
|
252
|
-
created.
|
253
|
-
|
254
|
-
*Alberto Almagro*
|
255
|
-
|
256
|
-
* Support `-` as a platform-agnostic way to run a script from stdin with
|
257
|
-
`rails runner`
|
258
|
-
|
259
|
-
*Cody Cutrer*
|
260
|
-
|
261
|
-
* Add `bootsnap` to default `Gemfile`.
|
262
|
-
|
263
|
-
*Burke Libbey*
|
264
|
-
|
265
|
-
* Properly expand shortcuts for environment's name running the `console`
|
266
|
-
and `dbconsole` commands.
|
267
|
-
|
268
|
-
*Robin Dupret*
|
269
|
-
|
270
|
-
* Passing the environment's name as a regular argument to the
|
271
|
-
`rails dbconsole` and `rails console` commands is deprecated.
|
272
|
-
The `-e` option should be used instead.
|
267
|
+
* Deprecate passing Rack server name as a regular argument to `rails server`.
|
273
268
|
|
274
269
|
Previously:
|
275
270
|
|
276
|
-
$ bin/rails
|
277
|
-
|
278
|
-
Now:
|
279
|
-
|
280
|
-
$ bin/rails dbconsole -e production
|
281
|
-
|
282
|
-
*Robin Dupret*, *Kasper Timm Hansen*
|
283
|
-
|
284
|
-
* Allow passing a custom connection name to the `rails dbconsole`
|
285
|
-
command when using a 3-level database configuration.
|
286
|
-
|
287
|
-
$ bin/rails dbconsole -c replica
|
288
|
-
|
289
|
-
*Robin Dupret*, *Jeremy Daer*
|
271
|
+
$ bin/rails server thin
|
290
272
|
|
291
|
-
|
273
|
+
There wasn't an explicit option for the Rack server to use, now we have the
|
274
|
+
`--using` option with the `-u` short switch.
|
292
275
|
|
293
|
-
|
294
|
-
the update task honors those skips too.
|
295
|
-
|
296
|
-
*Yuji Yaginuma*
|
297
|
-
|
298
|
-
* Make Rails' test runner work better with minitest plugins.
|
299
|
-
|
300
|
-
By demoting the Rails test runner to just another minitest plugin —
|
301
|
-
and thereby not eager loading it — we can co-exist much better with
|
302
|
-
other minitest plugins such as pride and minitest-focus.
|
303
|
-
|
304
|
-
*Kasper Timm Hansen*
|
305
|
-
|
306
|
-
* Load environment file in `dbconsole` command.
|
307
|
-
|
308
|
-
Fixes #29717.
|
309
|
-
|
310
|
-
*Yuji Yaginuma*
|
311
|
-
|
312
|
-
* Add `rails secrets:show` command.
|
313
|
-
|
314
|
-
*Yuji Yaginuma*
|
315
|
-
|
316
|
-
* Allow mounting the same engine several times in different locations.
|
317
|
-
|
318
|
-
Fixes #20204.
|
319
|
-
|
320
|
-
*David Rodríguez*
|
321
|
-
|
322
|
-
* Clear screenshot files in `tmp:clear` task.
|
323
|
-
|
324
|
-
*Yuji Yaginuma*
|
325
|
-
|
326
|
-
* Add `railtie.rb` to the plugin generator
|
327
|
-
|
328
|
-
*Tsukuru Tanimichi*
|
329
|
-
|
330
|
-
* Deprecate `capify!` method in generators and templates.
|
276
|
+
Now:
|
331
277
|
|
332
|
-
|
278
|
+
$ bin/rails server -u thin
|
333
279
|
|
334
|
-
|
280
|
+
This change also improves the error message if a missing or mistyped rack
|
281
|
+
server is given.
|
335
282
|
|
336
|
-
|
283
|
+
*Genadi Samokovarov*
|
337
284
|
|
338
|
-
|
285
|
+
* Add "rails routes --expanded" option to output routes in expanded mode like
|
286
|
+
"psql --expanded". Result looks like:
|
339
287
|
|
340
|
-
|
288
|
+
```
|
289
|
+
$ rails routes --expanded
|
290
|
+
--[ Route 1 ]------------------------------------------------------------
|
291
|
+
Prefix | high_scores
|
292
|
+
Verb | GET
|
293
|
+
URI | /high_scores(.:format)
|
294
|
+
Controller#Action | high_scores#index
|
295
|
+
--[ Route 2 ]------------------------------------------------------------
|
296
|
+
Prefix | new_high_score
|
297
|
+
Verb | GET
|
298
|
+
URI | /high_scores/new(.:format)
|
299
|
+
Controller#Action | high_scores#new
|
300
|
+
```
|
341
301
|
|
342
|
-
*
|
302
|
+
*Benoit Tigeot*
|
343
303
|
|
344
|
-
*
|
345
|
-
when using Turbolinks.
|
304
|
+
* Rails 6 requires Ruby 2.5.0 or newer.
|
346
305
|
|
347
|
-
*
|
306
|
+
*Jeremy Daer*, *Kasper Timm Hansen*
|
348
307
|
|
349
308
|
|
350
|
-
Please check [5-
|
309
|
+
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/railties/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
data/RDOC_MAIN.rdoc
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
= Welcome to \Rails
|
2
|
+
|
3
|
+
== What's \Rails
|
2
4
|
|
3
5
|
\Rails is a web-application framework that includes everything needed to
|
4
6
|
create database-backed web applications according to the
|
@@ -6,43 +8,48 @@ create database-backed web applications according to the
|
|
6
8
|
pattern.
|
7
9
|
|
8
10
|
Understanding the MVC pattern is key to understanding \Rails. MVC divides your
|
9
|
-
application into three layers, each with a specific responsibility.
|
11
|
+
application into three layers: Model, View, and Controller, each with a specific responsibility.
|
12
|
+
|
13
|
+
== Model layer
|
10
14
|
|
11
|
-
The <em>Model layer</em> represents
|
12
|
-
Person, Post, etc.) and encapsulates the business logic
|
15
|
+
The <em><b>Model layer</b></em> represents the domain model (such as Account, Product,
|
16
|
+
Person, Post, etc.) and encapsulates the business logic specific to
|
13
17
|
your application. In \Rails, database-backed model classes are derived from
|
14
|
-
ActiveRecord::Base
|
18
|
+
<tt>ActiveRecord::Base</tt>. {Active Record}[link:files/activerecord/README_rdoc.html] allows you to present the data from
|
15
19
|
database rows as objects and embellish these data objects with business logic
|
16
|
-
methods.
|
17
|
-
Although most \Rails models are backed by a database, models can also be ordinary
|
20
|
+
methods. Although most \Rails models are backed by a database, models can also be ordinary
|
18
21
|
Ruby classes, or Ruby classes that implement a set of interfaces as provided by
|
19
|
-
the Active Model
|
22
|
+
the {Active Model}[link:files/activemodel/README_rdoc.html] module.
|
20
23
|
|
21
|
-
|
24
|
+
== Controller layer
|
25
|
+
|
26
|
+
The <em><b>Controller layer</b></em> is responsible for handling incoming HTTP requests and
|
22
27
|
providing a suitable response. Usually this means returning \HTML, but \Rails controllers
|
23
28
|
can also generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and
|
24
29
|
manipulate models, and render view templates in order to generate the appropriate HTTP response.
|
25
30
|
In \Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and
|
26
|
-
controller classes are derived from ActionController::Base
|
27
|
-
are bundled together in Action Pack.
|
28
|
-
|
31
|
+
controller classes are derived from <tt>ActionController::Base</tt>. Action Dispatch and Action Controller
|
32
|
+
are bundled together in {Action Pack}[link:files/actionpack/README_rdoc.html].
|
33
|
+
|
34
|
+
== View layer
|
29
35
|
|
30
|
-
The <em>View layer</em> is composed of "templates" that are responsible for providing
|
36
|
+
The <em><b>View layer</b></em> is composed of "templates" that are responsible for providing
|
31
37
|
appropriate representations of your application's resources. Templates can
|
32
38
|
come in a variety of formats, but most view templates are \HTML with embedded
|
33
39
|
Ruby code (ERB files). Views are typically rendered to generate a controller response,
|
34
|
-
or to generate the body of an email. In \Rails, View generation is handled by Action View.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
and
|
40
|
+
or to generate the body of an email. In \Rails, View generation is handled by {Action View}[link:files/actionview/README_rdoc.html].
|
41
|
+
|
42
|
+
== Frameworks and libraries
|
43
|
+
|
44
|
+
{Active Record}[link:files/activerecord/README_rdoc.html], {Active Model}[link:files/activemodel/README_rdoc.html],
|
45
|
+
{Action Pack}[link:files/actionpack/README_rdoc.html], and {Action View}[link:files/actionview/README_rdoc.html] can each be used independently outside \Rails.
|
46
|
+
In addition to that, \Rails also comes with {Action Mailer}[link:files/actionmailer/README_rdoc.html], a library
|
47
|
+
to generate and send emails; {Action Mailbox}[link:files/actionmailbox/README_md.html], a library to receive emails within a Rails application;
|
48
|
+
{Active Job}[link:files/activejob/README_md.html], a framework for declaring jobs and making them run on a variety of queueing
|
49
|
+
backends; {Action Cable}[link:files/actioncable/README_md.html], a framework to
|
50
|
+
integrate WebSockets with a \Rails application; {Active Storage}[link:files/activestorage/README_md.html],
|
51
|
+
a library to attach cloud and local files to \Rails applications; {Action Text}[link:files/actiontext/README_md.html], a library to handle rich text content;
|
52
|
+
and {Active Support}[link:files/activesupport/README_rdoc.html], a collection
|
46
53
|
of utility classes and standard library extensions that are useful for \Rails,
|
47
54
|
and may also be used independently outside \Rails.
|
48
55
|
|
@@ -70,15 +77,15 @@ and may also be used independently outside \Rails.
|
|
70
77
|
5. Follow the guidelines to start developing your application. You may find the following resources handy:
|
71
78
|
|
72
79
|
* The \README file created within your application.
|
73
|
-
* {Getting Started with \Rails}[
|
74
|
-
* {Ruby on \Rails Guides}[
|
80
|
+
* {Getting Started with \Rails}[https://guides.rubyonrails.org/getting_started.html].
|
81
|
+
* {Ruby on \Rails Guides}[https://guides.rubyonrails.org].
|
75
82
|
* {The API Documentation}[http://api.rubyonrails.org].
|
76
83
|
* {Ruby on \Rails Tutorial}[https://www.railstutorial.org/book].
|
77
84
|
|
78
85
|
== Contributing
|
79
86
|
|
80
87
|
We encourage you to contribute to Ruby on \Rails! Please check out the
|
81
|
-
{Contributing to Ruby on \Rails guide}[
|
88
|
+
{Contributing to Ruby on \Rails guide}[https://guides.rubyonrails.org/contributing_to_ruby_on_rails.html] for guidelines about how to proceed. {Join us!}[http://contributors.rubyonrails.org]
|
82
89
|
|
83
90
|
Trying to report a possible security vulnerability in \Rails? Please
|
84
91
|
check out our {security policy}[http://rubyonrails.org/security/] for
|
data/README.rdoc
CHANGED
@@ -17,7 +17,7 @@ The latest version of Railties can be installed with RubyGems:
|
|
17
17
|
|
18
18
|
Source code can be downloaded as part of the Rails project on GitHub
|
19
19
|
|
20
|
-
* https://github.com/rails/rails/tree/
|
20
|
+
* https://github.com/rails/rails/tree/master/railties
|
21
21
|
|
22
22
|
== License
|
23
23
|
|