mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Rename master to main in all code references
This commit is contained in:
parent
2d817d7707
commit
077c66d5d6
39 changed files with 108 additions and 108 deletions
2
.github/stale.yml
vendored
2
.github/stale.yml
vendored
|
@ -20,7 +20,7 @@ markComment: >
|
|||
|
||||
The resources of the Rails team are limited, and so we are asking for your help.
|
||||
|
||||
If you can still reproduce this error on the `6-1-stable` branch or on `master`,
|
||||
If you can still reproduce this error on the `6-1-stable` branch or on `main`,
|
||||
please reply with all of the information you have about it in order to keep the issue open.
|
||||
|
||||
Thank you for all your contributions.
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/rails/rails/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.
|
||||
|
||||
* If possible, use the relevant bug report templates to create the issue. Simply copy the content of the appropriate template into a .rb file, make the necessary changes to demonstrate the issue, and **paste the content into the issue description**:
|
||||
* [**Active Record** (models, database) issues](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb)
|
||||
* [**Action Pack** (controllers, routing) issues](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_master.rb)
|
||||
* [**Generic template** for other issues](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_master.rb)
|
||||
* [**Active Record** (models, database) issues](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_main.rb)
|
||||
* [**Action Pack** (controllers, routing) issues](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_main.rb)
|
||||
* [**Generic template** for other issues](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_main.rb)
|
||||
|
||||
* For more detailed information on submitting a bug report and creating an issue, visit our [reporting guidelines](https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#reporting-an-issue).
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ Everyone interacting in Rails and its sub-projects' codebases, issue trackers, c
|
|||
|
||||
## Code Status
|
||||
|
||||
[![Build Status](https://badge.buildkite.com/ab1152b6a1f6a61d3ea4ec5b3eece8d4c2b830998459c75352.svg?branch=master)](https://buildkite.com/rails/rails)
|
||||
[![Build Status](https://badge.buildkite.com/ab1152b6a1f6a61d3ea4ec5b3eece8d4c2b830998459c75352.svg?branch=main)](https://buildkite.com/rails/rails)
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ You can review the commits for the 3.0.10 release like this:
|
|||
```
|
||||
|
||||
If you're doing a stable branch release, you should also ensure that all of
|
||||
the CHANGELOG entries in the stable branch are also synced to the master
|
||||
the CHANGELOG entries in the stable branch are also synced to the main
|
||||
branch.
|
||||
|
||||
### Put the new version in the RAILS_VERSION file.
|
||||
|
|
|
@ -116,7 +116,7 @@ The latest version of Action Mailer can be installed with RubyGems:
|
|||
|
||||
Source code can be downloaded as part of the Rails project on GitHub:
|
||||
|
||||
* https://github.com/rails/rails/tree/master/actionmailer
|
||||
* https://github.com/rails/rails/tree/main/actionmailer
|
||||
|
||||
|
||||
== License
|
||||
|
|
|
@ -33,7 +33,7 @@ The latest version of Action Pack can be installed with RubyGems:
|
|||
|
||||
Source code can be downloaded as part of the Rails project on GitHub:
|
||||
|
||||
* https://github.com/rails/rails/tree/master/actionpack
|
||||
* https://github.com/rails/rails/tree/main/actionpack
|
||||
|
||||
|
||||
== License
|
||||
|
|
|
@ -15,7 +15,7 @@ The latest version of Action View can be installed with RubyGems:
|
|||
|
||||
Source code can be downloaded as part of the Rails project on GitHub:
|
||||
|
||||
* https://github.com/rails/rails/tree/master/actionview
|
||||
* https://github.com/rails/rails/tree/main/actionview
|
||||
|
||||
|
||||
== License
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Unobtrusive JavaScript
|
||||
https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts
|
||||
https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts
|
||||
Released under the MIT license
|
||||
*/
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "bundle exec blade build",
|
||||
"test": "echo \"See the README: https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts#how-to-run-tests\" && exit 1",
|
||||
"test": "echo \"See the README: https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts#how-to-run-tests\" && exit 1",
|
||||
"lint": "coffeelint app/assets/javascripts && eslint test/ujs/public/test"
|
||||
},
|
||||
"repository": {
|
||||
|
|
|
@ -106,7 +106,7 @@ The latest version of Active Job can be installed with RubyGems:
|
|||
|
||||
Source code can be downloaded as part of the Rails project on GitHub:
|
||||
|
||||
* https://github.com/rails/rails/tree/master/activejob
|
||||
* https://github.com/rails/rails/tree/main/activejob
|
||||
|
||||
|
||||
## License
|
||||
|
|
|
@ -241,7 +241,7 @@ The latest version of Active Model can be installed with RubyGems:
|
|||
|
||||
Source code can be downloaded as part of the Rails project on GitHub
|
||||
|
||||
* https://github.com/rails/rails/tree/master/activemodel
|
||||
* https://github.com/rails/rails/tree/main/activemodel
|
||||
|
||||
|
||||
== License
|
||||
|
|
|
@ -194,7 +194,7 @@ The latest version of Active Record can be installed with RubyGems:
|
|||
|
||||
Source code can be downloaded as part of the Rails project on GitHub:
|
||||
|
||||
* https://github.com/rails/rails/tree/master/activerecord
|
||||
* https://github.com/rails/rails/tree/main/activerecord
|
||||
|
||||
|
||||
== License
|
||||
|
|
|
@ -10,7 +10,7 @@ You can read more about Active Storage in the [Active Storage Overview](https://
|
|||
|
||||
## Compared to other storage solutions
|
||||
|
||||
A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in [Blob](https://github.com/rails/rails/blob/master/activestorage/app/models/active_storage/blob.rb) and [Attachment](https://github.com/rails/rails/blob/master/activestorage/app/models/active_storage/attachment.rb) models (backed by Active Record). This means existing application models do not need to be modified with additional columns to associate with files. Active Storage uses polymorphic associations via the `Attachment` join model, which then connects to the actual `Blob`.
|
||||
A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in [Blob](https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/blob.rb) and [Attachment](https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/attachment.rb) models (backed by Active Record). This means existing application models do not need to be modified with additional columns to associate with files. Active Storage uses polymorphic associations via the `Attachment` join model, which then connects to the actual `Blob`.
|
||||
|
||||
`Blob` models store attachment metadata (filename, content-type, etc.), and their identifier key in the storage service. Blob models do not store the actual binary data. They are intended to be immutable in spirit. One file, one blob. You can associate the same blob with multiple application models as well. And if you want to do transformations of a given `Blob`, the idea is that you'll simply create a new one, rather than attempt to mutate the existing one (though of course you can delete the previous version later if you don't need it).
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ The latest version of Active Support can be installed with RubyGems:
|
|||
|
||||
Source code can be downloaded as part of the Rails project on GitHub:
|
||||
|
||||
* https://github.com/rails/rails/tree/master/activesupport
|
||||
* https://github.com/rails/rails/tree/main/activesupport
|
||||
|
||||
|
||||
== License
|
||||
|
|
|
@ -7,7 +7,7 @@ gemfile(true) do
|
|||
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
gem "rails", github: "rails/rails"
|
||||
gem "rails", github: "rails/rails", branch: "main"
|
||||
end
|
||||
|
||||
require "action_controller/railtie"
|
|
@ -7,7 +7,7 @@ gemfile(true) do
|
|||
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
gem "rails", github: "rails/rails"
|
||||
gem "rails", github: "rails/rails", branch: "main"
|
||||
gem "sqlite3"
|
||||
end
|
||||
|
|
@ -7,7 +7,7 @@ gemfile(true) do
|
|||
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
gem "rails", github: "rails/rails"
|
||||
gem "rails", github: "rails/rails", branch: "main"
|
||||
end
|
||||
|
||||
require "active_job"
|
|
@ -7,7 +7,7 @@ gemfile(true) do
|
|||
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
gem "rails", github: "rails/rails"
|
||||
gem "rails", github: "rails/rails", branch: "main"
|
||||
gem "sqlite3"
|
||||
end
|
||||
|
|
@ -7,7 +7,7 @@ gemfile(true) do
|
|||
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
gem "rails", github: "rails/rails"
|
||||
gem "rails", github: "rails/rails", branch: "main"
|
||||
gem "sqlite3"
|
||||
end
|
||||
|
|
@ -7,7 +7,7 @@ gemfile(true) do
|
|||
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
gem "rails", github: "rails/rails"
|
||||
gem "rails", github: "rails/rails", branch: "main"
|
||||
gem "sqlite3"
|
||||
end
|
||||
|
|
@ -7,7 +7,7 @@ gemfile(true) do
|
|||
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
gem "rails", github: "rails/rails"
|
||||
gem "rails", github: "rails/rails", branch: "main"
|
||||
end
|
||||
|
||||
require "active_support"
|
|
@ -234,11 +234,11 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/a
|
|||
The method `change_table` is also reversible, as long as its block doesn't call `remove`, `change` or `change_default`
|
||||
|
||||
* New method `reversible` makes it possible to specify code to be run when migrating up or down.
|
||||
See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/active_record_migrations.md#using-reversible)
|
||||
See the [Guide on Migration](https://github.com/rails/rails/blob/main/guides/source/active_record_migrations.md#using-reversible)
|
||||
|
||||
* New method `revert` will revert a whole migration or the given block.
|
||||
If migrating down, the given migration / block is run normally.
|
||||
See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/active_record_migrations.md#reverting-previous-migrations)
|
||||
See the [Guide on Migration](https://github.com/rails/rails/blob/main/guides/source/active_record_migrations.md#reverting-previous-migrations)
|
||||
|
||||
* Adds PostgreSQL array type support. Any datatype can be used to create an array column, with full migration and schema dumper support.
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ Highlights in Rails 6.1:
|
|||
|
||||
These release notes cover only the major changes. To learn about various bug
|
||||
fixes and changes, please refer to the change logs or check out the [list of
|
||||
commits](https://github.com/rails/rails/commits/master) in the main Rails
|
||||
commits](https://github.com/rails/rails/commits/6-1-stable) in the main Rails
|
||||
repository on GitHub.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -185,7 +185,7 @@ Please refer to the [Changelog][action-mailer] for detailed changes.
|
|||
|
||||
### Removals
|
||||
|
||||
* Remove deprecated `ActionMailer::Base.receive` in favor of [Action Mailbox](https://github.com/rails/rails/tree/master/actionmailbox).
|
||||
* Remove deprecated `ActionMailer::Base.receive` in favor of [Action Mailbox](https://github.com/rails/rails/tree/6-1-stable/actionmailbox).
|
||||
|
||||
### Deprecations
|
||||
|
||||
|
@ -458,16 +458,16 @@ See the
|
|||
for the many people who spent many hours making Rails, the stable and robust
|
||||
framework it is. Kudos to all of them.
|
||||
|
||||
[railties]: https://github.com/rails/rails/blob/master/railties/CHANGELOG.md
|
||||
[action-pack]: https://github.com/rails/rails/blob/master/actionpack/CHANGELOG.md
|
||||
[action-view]: https://github.com/rails/rails/blob/master/actionview/CHANGELOG.md
|
||||
[action-mailer]: https://github.com/rails/rails/blob/master/actionmailer/CHANGELOG.md
|
||||
[action-cable]: https://github.com/rails/rails/blob/master/actioncable/CHANGELOG.md
|
||||
[active-record]: https://github.com/rails/rails/blob/master/activerecord/CHANGELOG.md
|
||||
[active-storage]: https://github.com/rails/rails/blob/master/activestorage/CHANGELOG.md
|
||||
[active-model]: https://github.com/rails/rails/blob/master/activemodel/CHANGELOG.md
|
||||
[active-support]: https://github.com/rails/rails/blob/master/activesupport/CHANGELOG.md
|
||||
[active-job]: https://github.com/rails/rails/blob/master/activejob/CHANGELOG.md
|
||||
[action-text]: https://github.com/rails/rails/blob/master/actiontext/CHANGELOG.md
|
||||
[action-mailbox]: https://github.com/rails/rails/blob/master/actionmailbox/CHANGELOG.md
|
||||
[guides]: https://github.com/rails/rails/blob/master/guides/CHANGELOG.md
|
||||
[railties]: https://github.com/rails/rails/blob/6-1-stable/railties/CHANGELOG.md
|
||||
[action-pack]: https://github.com/rails/rails/blob/6-1-stable/actionpack/CHANGELOG.md
|
||||
[action-view]: https://github.com/rails/rails/blob/6-1-stable/actionview/CHANGELOG.md
|
||||
[action-mailer]: https://github.com/rails/rails/blob/6-1-stable/actionmailer/CHANGELOG.md
|
||||
[action-cable]: https://github.com/rails/rails/blob/6-1-stable/actioncable/CHANGELOG.md
|
||||
[active-record]: https://github.com/rails/rails/blob/6-1-stable/activerecord/CHANGELOG.md
|
||||
[active-storage]: https://github.com/rails/rails/blob/6-1-stable/activestorage/CHANGELOG.md
|
||||
[active-model]: https://github.com/rails/rails/blob/6-1-stable/activemodel/CHANGELOG.md
|
||||
[active-support]: https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md
|
||||
[active-job]: https://github.com/rails/rails/blob/6-1-stable/activejob/CHANGELOG.md
|
||||
[action-text]: https://github.com/rails/rails/blob/6-1-stable/actiontext/CHANGELOG.md
|
||||
[action-mailbox]: https://github.com/rails/rails/blob/6-1-stable/actionmailbox/CHANGELOG.md
|
||||
[guides]: https://github.com/rails/rails/blob/6-1-stable/guides/CHANGELOG.md
|
||||
|
|
|
@ -170,16 +170,16 @@ See the
|
|||
for the many people who spent many hours making Rails, the stable and robust
|
||||
framework it is. Kudos to all of them.
|
||||
|
||||
[railties]: https://github.com/rails/rails/blob/master/railties/CHANGELOG.md
|
||||
[action-pack]: https://github.com/rails/rails/blob/master/actionpack/CHANGELOG.md
|
||||
[action-view]: https://github.com/rails/rails/blob/master/actionview/CHANGELOG.md
|
||||
[action-mailer]: https://github.com/rails/rails/blob/master/actionmailer/CHANGELOG.md
|
||||
[action-cable]: https://github.com/rails/rails/blob/master/actioncable/CHANGELOG.md
|
||||
[active-record]: https://github.com/rails/rails/blob/master/activerecord/CHANGELOG.md
|
||||
[active-storage]: https://github.com/rails/rails/blob/master/activestorage/CHANGELOG.md
|
||||
[active-model]: https://github.com/rails/rails/blob/master/activemodel/CHANGELOG.md
|
||||
[active-support]: https://github.com/rails/rails/blob/master/activesupport/CHANGELOG.md
|
||||
[active-job]: https://github.com/rails/rails/blob/master/activejob/CHANGELOG.md
|
||||
[action-text]: https://github.com/rails/rails/blob/master/actiontext/CHANGELOG.md
|
||||
[action-mailbox]: https://github.com/rails/rails/blob/master/actionmailbox/CHANGELOG.md
|
||||
[guides]: https://github.com/rails/rails/blob/master/guides/CHANGELOG.md
|
||||
[railties]: https://github.com/rails/rails/blob/main/railties/CHANGELOG.md
|
||||
[action-pack]: https://github.com/rails/rails/blob/main/actionpack/CHANGELOG.md
|
||||
[action-view]: https://github.com/rails/rails/blob/main/actionview/CHANGELOG.md
|
||||
[action-mailer]: https://github.com/rails/rails/blob/main/actionmailer/CHANGELOG.md
|
||||
[action-cable]: https://github.com/rails/rails/blob/main/actioncable/CHANGELOG.md
|
||||
[active-record]: https://github.com/rails/rails/blob/main/activerecord/CHANGELOG.md
|
||||
[active-storage]: https://github.com/rails/rails/blob/main/activestorage/CHANGELOG.md
|
||||
[active-model]: https://github.com/rails/rails/blob/main/activemodel/CHANGELOG.md
|
||||
[active-support]: https://github.com/rails/rails/blob/main/activesupport/CHANGELOG.md
|
||||
[active-job]: https://github.com/rails/rails/blob/main/activejob/CHANGELOG.md
|
||||
[action-text]: https://github.com/rails/rails/blob/main/actiontext/CHANGELOG.md
|
||||
[action-mailbox]: https://github.com/rails/rails/blob/main/actionmailbox/CHANGELOG.md
|
||||
[guides]: https://github.com/rails/rails/blob/main/guides/CHANGELOG.md
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<% if @edge %>
|
||||
<p>
|
||||
These are <b>Edge Guides</b>, based on <a href="https://github.com/rails/rails/tree/<%= @edge %>">master@<%= @edge[0, 7] %></a>.
|
||||
These are <b>Edge Guides</b>, based on <a href="https://github.com/rails/rails/tree/<%= @edge %>">main@<%= @edge[0, 7] %></a>.
|
||||
</p>
|
||||
<p>
|
||||
If you are looking for the ones for the stable version, please check
|
||||
|
|
|
@ -608,7 +608,7 @@ URL helper.
|
|||
<%= user_url(@user, host: 'example.com') %>
|
||||
```
|
||||
|
||||
NOTE: non-`GET` links require [rails-ujs](https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts) or
|
||||
NOTE: non-`GET` links require [rails-ujs](https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts) or
|
||||
[jQuery UJS](https://github.com/rails/jquery-ujs), and won't work in mailer templates.
|
||||
They will result in normal `GET` requests.
|
||||
|
||||
|
|
|
@ -483,7 +483,7 @@ accessible by default. Anyone that knows the blob URL will be able to download i
|
|||
even if a `before_action` in your `ApplicationController` would otherwise
|
||||
require a login. If your files require a higher level of protection consider
|
||||
implementing your own authenticated
|
||||
[`ActiveStorage::Blobs::RedirectController`](https://github.com/rails/rails/blob/master/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb) and [`ActiveStorage::Representations::RedirectController`](https://github.com/rails/rails/blob/master/activestorage/app/controllers/active_storage/representations/redirect_controller.rb).
|
||||
[`ActiveStorage::Blobs::RedirectController`](https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb) and [`ActiveStorage::Representations::RedirectController`](https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/representations/redirect_controller.rb).
|
||||
|
||||
To create a download link, use the `rails_blob_{path|url}` helper. Using this
|
||||
helper allows you to set the disposition.
|
||||
|
@ -1006,5 +1006,5 @@ Implementing Support for Other Cloud Services
|
|||
|
||||
If you need to support a cloud service other than these, you will need to
|
||||
implement the Service. Each service extends
|
||||
[`ActiveStorage::Service`](https://github.com/rails/rails/blob/master/activestorage/lib/active_storage/service.rb)
|
||||
[`ActiveStorage::Service`](https://github.com/rails/rails/blob/main/activestorage/lib/active_storage/service.rb)
|
||||
by implementing the methods necessary to upload and download files to the cloud.
|
||||
|
|
|
@ -39,15 +39,15 @@ Then, don't get your hopes up! Unless you have a "Code Red, Mission Critical, th
|
|||
|
||||
Having a way to reproduce your issue will be very helpful for others to help confirm, investigate, and ultimately fix your issue. You can do this by providing an executable test case. To make this process easier, we have prepared several bug report templates for you to use as a starting point:
|
||||
|
||||
* Template for Active Record (models, database) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb)
|
||||
* Template for testing Active Record (migration) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_migrations_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_migrations_master.rb)
|
||||
* Template for Action Pack (controllers, routing) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_master.rb)
|
||||
* Template for Active Job issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_job_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_job_master.rb)
|
||||
* Template for Active Storage issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_storage_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_storage_master.rb)
|
||||
* Template for Action Mailbox issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_mailbox_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_mailbox_master.rb)
|
||||
* Generic template for other issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_master.rb)
|
||||
* Template for Active Record (models, database) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_main.rb)
|
||||
* Template for testing Active Record (migration) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_migrations_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_migrations_main.rb)
|
||||
* Template for Action Pack (controllers, routing) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_main.rb)
|
||||
* Template for Active Job issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_job_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_job_main.rb)
|
||||
* Template for Active Storage issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_main.rb)
|
||||
* Template for Action Mailbox issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_main.rb)
|
||||
* Generic template for other issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_main.rb)
|
||||
|
||||
These templates include the boilerplate code to set up a test case against either a released version of Rails (`*_gem.rb`) or edge Rails (`*_master.rb`).
|
||||
These templates include the boilerplate code to set up a test case against either a released version of Rails (`*_gem.rb`) or edge Rails (`*_main.rb`).
|
||||
|
||||
Copy the content of the appropriate template into a `.rb` file and make the necessary changes to demonstrate the issue. You can execute it by running `ruby the_file.rb` in your terminal. If all goes well, you should see your test case failing.
|
||||
|
||||
|
@ -136,8 +136,8 @@ learn about Ruby on Rails, and the API, which serves as a reference.
|
|||
|
||||
You can help improve the Rails guides or the API reference by making them more coherent, consistent, or readable, adding missing information, correcting factual errors, fixing typos, or bringing them up to date with the latest edge Rails.
|
||||
|
||||
To do so, make changes to Rails guides source files (located [here](https://github.com/rails/rails/tree/master/guides/source) on GitHub) or RDoc comments in source code. Then open a pull request to apply your
|
||||
changes to the master branch.
|
||||
To do so, make changes to Rails guides source files (located [here](https://github.com/rails/rails/tree/main/guides/source) on GitHub) or RDoc comments in source code. Then open a pull request to apply your
|
||||
changes to the main branch.
|
||||
|
||||
When working with documentation, please take into account the [API Documentation Guidelines](api_documentation_guidelines.html) and the [Ruby on Rails Guides Guidelines](ruby_on_rails_guides_guidelines.html).
|
||||
|
||||
|
@ -291,7 +291,7 @@ Therefore, you should test your change against a list of representative
|
|||
scenarios. Ideally, they should be based on real-world scenarios extracted
|
||||
from production applications.
|
||||
|
||||
You can use the [benchmark template](https://github.com/rails/rails/blob/master/guides/bug_report_templates/benchmark.rb)
|
||||
You can use the [benchmark template](https://github.com/rails/rails/blob/main/guides/bug_report_templates/benchmark.rb)
|
||||
as a starting point. It includes the boilerplate code to set up a benchmark
|
||||
using the [benchmark-ips](https://github.com/evanphx/benchmark-ips) gem. The
|
||||
template is designed for testing relatively self-contained changes that can be
|
||||
|
@ -532,10 +532,10 @@ simplifies future cherry picks and keeps the git log clean.
|
|||
|
||||
### Update Your Branch
|
||||
|
||||
It's pretty likely that other changes to master have happened while you were working. Go get them:
|
||||
It's pretty likely that other changes to main have happened while you were working. Go get them:
|
||||
|
||||
```bash
|
||||
$ git checkout master
|
||||
$ git checkout main
|
||||
$ git pull --rebase
|
||||
```
|
||||
|
||||
|
@ -543,7 +543,7 @@ Now reapply your patch on top of the latest changes:
|
|||
|
||||
```bash
|
||||
$ git checkout my_new_branch
|
||||
$ git rebase master
|
||||
$ git rebase main
|
||||
```
|
||||
|
||||
No conflicts? Tests still pass? Change still seems reasonable to you? Then move on.
|
||||
|
@ -573,16 +573,16 @@ $ git fetch rails
|
|||
Merge the new content:
|
||||
|
||||
```bash
|
||||
$ git checkout master
|
||||
$ git rebase rails/master
|
||||
$ git checkout main
|
||||
$ git rebase rails/main
|
||||
$ git checkout my_new_branch
|
||||
$ git rebase rails/master
|
||||
$ git rebase rails/main
|
||||
```
|
||||
|
||||
Update your fork:
|
||||
|
||||
```bash
|
||||
$ git push fork master
|
||||
$ git push fork main
|
||||
$ git push fork my_new_branch
|
||||
```
|
||||
|
||||
|
@ -594,7 +594,7 @@ the right panel. On the next page, press "New pull request" in the upper right
|
|||
hand corner.
|
||||
|
||||
Click on "Edit", if you need to change the branches being compared (it compares
|
||||
"master" by default) and press "Click to create a pull request for this
|
||||
"main" by default) and press "Click to create a pull request for this
|
||||
comparison".
|
||||
|
||||
Ensure the changesets you introduced are included. Fill in some details about
|
||||
|
@ -643,7 +643,7 @@ extraneous commits can add a lot of noise.
|
|||
```bash
|
||||
$ git fetch rails
|
||||
$ git checkout my_new_branch
|
||||
$ git rebase -i rails/master
|
||||
$ git rebase -i rails/main
|
||||
|
||||
< Choose 'squash' for all of your commits except the first one. >
|
||||
< Edit the commit message to make sense, and describe all your changes. >
|
||||
|
@ -687,20 +687,20 @@ NOTE: Before working on older versions, please check the [maintenance policy](ma
|
|||
|
||||
#### Backporting
|
||||
|
||||
Changes that are merged into master are intended for the next major release of Rails. Sometimes, it might be beneficial for your changes to propagate back to the maintenance releases for older stable branches. Generally, security fixes and bug fixes are good candidates for a backport, while new features and patches that introduce a change in behavior will not be accepted. When in doubt, it is best to consult a Rails team member before backporting your changes to avoid wasted effort.
|
||||
Changes that are merged into main are intended for the next major release of Rails. Sometimes, it might be beneficial for your changes to propagate back to the maintenance releases for older stable branches. Generally, security fixes and bug fixes are good candidates for a backport, while new features and patches that introduce a change in behavior will not be accepted. When in doubt, it is best to consult a Rails team member before backporting your changes to avoid wasted effort.
|
||||
|
||||
For simple fixes, the easiest way to backport your changes is to [extract a diff from your changes in master and apply them to the target branch](https://www.devroom.io/2009/10/26/how-to-create-and-apply-a-patch-with-git/).
|
||||
For simple fixes, the easiest way to backport your changes is to [extract a diff from your changes in main and apply them to the target branch](https://www.devroom.io/2009/10/26/how-to-create-and-apply-a-patch-with-git/).
|
||||
|
||||
First, make sure your changes are the only difference between your current branch and master:
|
||||
First, make sure your changes are the only difference between your current branch and main:
|
||||
|
||||
```bash
|
||||
$ git log master..HEAD
|
||||
$ git log main..HEAD
|
||||
```
|
||||
|
||||
Then extract the diff:
|
||||
|
||||
```bash
|
||||
$ git format-patch master --stdout > ~/my_changes.patch
|
||||
$ git format-patch main --stdout > ~/my_changes.patch
|
||||
```
|
||||
|
||||
Switch over to the target branch and apply your changes:
|
||||
|
@ -710,9 +710,9 @@ $ git checkout -b my_backport_branch 4-2-stable
|
|||
$ git apply ~/my_changes.patch
|
||||
```
|
||||
|
||||
This works well for simple changes. However, if your changes are complicated or if the code in master has deviated significantly from your target branch, it might require more work on your part. The difficulty of a backport varies greatly from case to case, and sometimes it is simply not worth the effort.
|
||||
This works well for simple changes. However, if your changes are complicated or if the code in main has deviated significantly from your target branch, it might require more work on your part. The difficulty of a backport varies greatly from case to case, and sometimes it is simply not worth the effort.
|
||||
|
||||
Once you have resolved all conflicts and made sure all the tests are passing, push your changes and open a separate pull request for your backport. It is also worth noting that older branches might have a different set of build targets than master. When possible, it is best to first test your backport locally against the oldest Ruby version permitted by the target branch's `rails.gemspec` before submitting your pull request.
|
||||
Once you have resolved all conflicts and made sure all the tests are passing, push your changes and open a separate pull request for your backport. It is also worth noting that older branches might have a different set of build targets than main. When possible, it is best to first test your backport locally against the oldest Ruby version permitted by the target branch's `rails.gemspec` before submitting your pull request.
|
||||
|
||||
And then... think about your next contribution!
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ en:
|
|||
hello: "Hello world"
|
||||
```
|
||||
|
||||
This means, that in the `:en` locale, the key _hello_ will map to the _Hello world_ string. Every string inside Rails is internationalized in this way, see for instance Active Model validation messages in the [`activemodel/lib/active_model/locale/en.yml`](https://github.com/rails/rails/blob/master/activemodel/lib/active_model/locale/en.yml) file or time and date formats in the [`activesupport/lib/active_support/locale/en.yml`](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml) file. You can use YAML or standard Ruby Hashes to store translations in the default (Simple) backend.
|
||||
This means, that in the `:en` locale, the key _hello_ will map to the _Hello world_ string. Every string inside Rails is internationalized in this way, see for instance Active Model validation messages in the [`activemodel/lib/active_model/locale/en.yml`](https://github.com/rails/rails/blob/main/activemodel/lib/active_model/locale/en.yml) file or time and date formats in the [`activesupport/lib/active_support/locale/en.yml`](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml) file. You can use YAML or standard Ruby Hashes to store translations in the default (Simple) backend.
|
||||
|
||||
The I18n library will use **English** as a **default locale**, i.e. if a different locale is not set, `:en` will be used for looking up translations.
|
||||
|
||||
|
@ -1043,23 +1043,23 @@ Rails uses fixed strings and other localizations, such as format strings and oth
|
|||
|
||||
#### Action View Helper Methods
|
||||
|
||||
* `distance_of_time_in_words` translates and pluralizes its result and interpolates the number of seconds, minutes, hours, and so on. See [datetime.distance_in_words](https://github.com/rails/rails/blob/master/actionview/lib/action_view/locale/en.yml#L4) translations.
|
||||
* `distance_of_time_in_words` translates and pluralizes its result and interpolates the number of seconds, minutes, hours, and so on. See [datetime.distance_in_words](https://github.com/rails/rails/blob/main/actionview/lib/action_view/locale/en.yml#L4) translations.
|
||||
|
||||
* `datetime_select` and `select_month` use translated month names for populating the resulting select tag. See [date.month_names](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L15) for translations. `datetime_select` also looks up the order option from [date.order](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L18) (unless you pass the option explicitly). All date selection helpers translate the prompt using the translations in the [datetime.prompts](https://github.com/rails/rails/blob/master/actionview/lib/action_view/locale/en.yml#L39) scope if applicable.
|
||||
* `datetime_select` and `select_month` use translated month names for populating the resulting select tag. See [date.month_names](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L15) for translations. `datetime_select` also looks up the order option from [date.order](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L18) (unless you pass the option explicitly). All date selection helpers translate the prompt using the translations in the [datetime.prompts](https://github.com/rails/rails/blob/main/actionview/lib/action_view/locale/en.yml#L39) scope if applicable.
|
||||
|
||||
* The `number_to_currency`, `number_with_precision`, `number_to_percentage`, `number_with_delimiter`, and `number_to_human_size` helpers use the number format settings located in the [number](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L37) scope.
|
||||
* The `number_to_currency`, `number_with_precision`, `number_to_percentage`, `number_with_delimiter`, and `number_to_human_size` helpers use the number format settings located in the [number](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L37) scope.
|
||||
|
||||
#### Active Model Methods
|
||||
|
||||
* `model_name.human` and `human_attribute_name` use translations for model names and attribute names if available in the [activerecord.models](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/locale/en.yml#L36) scope. They also support translations for inherited class names (e.g. for use with STI) as explained above in "Error message scopes".
|
||||
* `model_name.human` and `human_attribute_name` use translations for model names and attribute names if available in the [activerecord.models](https://github.com/rails/rails/blob/main/activerecord/lib/active_record/locale/en.yml#L36) scope. They also support translations for inherited class names (e.g. for use with STI) as explained above in "Error message scopes".
|
||||
|
||||
* `ActiveModel::Errors#generate_message` (which is used by Active Model validations but may also be used manually) uses `model_name.human` and `human_attribute_name` (see above). It also translates the error message and supports translations for inherited class names as explained above in "Error message scopes".
|
||||
|
||||
* `ActiveModel::Errors#full_messages` prepends the attribute name to the error message using a separator that will be looked up from [errors.format](https://github.com/rails/rails/blob/master/activemodel/lib/active_model/locale/en.yml#L4) (and which defaults to `"%{attribute} %{message}"`).
|
||||
* `ActiveModel::Errors#full_messages` prepends the attribute name to the error message using a separator that will be looked up from [errors.format](https://github.com/rails/rails/blob/main/activemodel/lib/active_model/locale/en.yml#L4) (and which defaults to `"%{attribute} %{message}"`).
|
||||
|
||||
#### Active Support Methods
|
||||
|
||||
* `Array#to_sentence` uses format settings as given in the [support.array](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L33) scope.
|
||||
* `Array#to_sentence` uses format settings as given in the [support.array](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L33) scope.
|
||||
|
||||
How to Store your Custom Translations
|
||||
-------------------------------------
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta name="cover" content="cover" />
|
||||
<dc-metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
|
||||
<dc:title>Ruby on Rails Guides (<%= @version || "master@#{@edge[0, 7]}" %>)</dc:title>
|
||||
<dc:title>Ruby on Rails Guides (<%= @version || "main@#{@edge[0, 7]}" %>)</dc:title>
|
||||
|
||||
<dc:language>en-us</dc:language>
|
||||
<dc:creator>Ruby on Rails</dc:creator>
|
||||
|
|
|
@ -102,9 +102,9 @@
|
|||
</p>
|
||||
<p>
|
||||
You may also find incomplete content or stuff that is not up to date.
|
||||
Please do add any missing documentation for master. Make sure to check
|
||||
Please do add any missing documentation for main. Make sure to check
|
||||
<%= link_to 'Edge Guides', 'https://edgeguides.rubyonrails.org' %> first to verify
|
||||
if the issues are already fixed or not on the master branch.
|
||||
if the issues are already fixed or not on the main branch.
|
||||
Check the <%= link_to 'Ruby on Rails Guides Guidelines', 'ruby_on_rails_guides_guidelines.html' %>
|
||||
for style and conventions.
|
||||
</p>
|
||||
|
|
|
@ -31,7 +31,7 @@ reserved for special occasions.
|
|||
New Features
|
||||
------------
|
||||
|
||||
New features are only added to the master branch and will not be made available
|
||||
New features are only added to the main branch and will not be made available
|
||||
in point releases.
|
||||
|
||||
Bug Fixes
|
||||
|
|
|
@ -299,7 +299,7 @@ protect_from_forgery with: :exception
|
|||
|
||||
This will include a security token in all forms and Ajax requests generated by Rails. If the security token doesn't match what was expected, an exception will be thrown.
|
||||
|
||||
NOTE: By default, Rails includes an [unobtrusive scripting adapter](https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts),
|
||||
NOTE: By default, Rails includes an [unobtrusive scripting adapter](https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts),
|
||||
which adds a header called `X-CSRF-Token` with the security token on every non-GET
|
||||
Ajax call. Without this header, non-GET Ajax requests won't be accepted by Rails.
|
||||
When using another library to make Ajax calls, it is necessary to add the security
|
||||
|
|
|
@ -159,7 +159,7 @@ Because of Unobtrusive JavaScript, the Rails "Ajax helpers" are actually in two
|
|||
parts: the JavaScript half and the Ruby half.
|
||||
|
||||
Unless you have disabled the Asset Pipeline,
|
||||
[rails-ujs](https://github.com/rails/rails/tree/master/actionview/app/assets/javascripts)
|
||||
[rails-ujs](https://github.com/rails/rails/tree/main/actionview/app/assets/javascripts)
|
||||
provides the JavaScript half, and the regular Ruby view helpers add appropriate
|
||||
tags to your DOM.
|
||||
|
||||
|
@ -562,6 +562,6 @@ Other Resources
|
|||
|
||||
Here are some helpful links to help you learn even more:
|
||||
|
||||
* [rails-ujs wiki](https://github.com/rails/rails/tree/master/actionview/app/assets/javascripts)
|
||||
* [rails-ujs wiki](https://github.com/rails/rails/tree/main/actionview/app/assets/javascripts)
|
||||
* [Railscasts: Unobtrusive JavaScript](http://railscasts.com/episodes/205-unobtrusive-javascript)
|
||||
* [Railscasts: Turbolinks](http://railscasts.com/episodes/390-turbolinks)
|
||||
|
|
|
@ -17,7 +17,7 @@ The latest version of Railties can be installed with RubyGems:
|
|||
|
||||
Source code can be downloaded as part of the Rails project on GitHub
|
||||
|
||||
* https://github.com/rails/rails/tree/master/railties
|
||||
* https://github.com/rails/rails/tree/main/railties
|
||||
|
||||
== License
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ module Rails
|
|||
|
||||
class EdgeTask < RepoTask
|
||||
def rails_version
|
||||
"master@#{`git rev-parse HEAD`[0, 7]}"
|
||||
"main@#{`git rev-parse HEAD`[0, 7]}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ module Rails
|
|||
desc: "Set up the #{name} with Gemfile pointing to Rails repository"
|
||||
|
||||
class_option :master, type: :boolean, default: false,
|
||||
desc: "Set up the #{name} with Gemfile pointing to Rails repository master branch"
|
||||
desc: "Set up the #{name} with Gemfile pointing to Rails repository main branch"
|
||||
|
||||
class_option :rc, type: :string, default: nil,
|
||||
desc: "Path to file containing extra configuration options for rails command"
|
||||
|
@ -277,16 +277,16 @@ module Rails
|
|||
]
|
||||
elsif options.edge?
|
||||
[
|
||||
GemfileEntry.github("rails", "rails/rails")
|
||||
GemfileEntry.github("rails", "rails/rails", "main")
|
||||
]
|
||||
elsif options.master?
|
||||
[
|
||||
GemfileEntry.github("rails", "rails/rails", "master")
|
||||
GemfileEntry.github("rails", "rails/rails", "main")
|
||||
]
|
||||
else
|
||||
[GemfileEntry.version("rails",
|
||||
rails_version_specifier,
|
||||
"Bundle edge Rails instead: gem 'rails', github: 'rails/rails'")]
|
||||
"Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'")]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -857,7 +857,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
|||
run_generator_instance
|
||||
|
||||
assert_equal 1, @bundle_commands.count("install")
|
||||
assert_file "Gemfile", %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["']$}
|
||||
assert_file "Gemfile", %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["'],\s+branch:\s+["']main["']$}
|
||||
end
|
||||
|
||||
def test_master_option
|
||||
|
@ -865,7 +865,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
|||
run_generator_instance
|
||||
|
||||
assert_equal 1, @bundle_commands.count("install")
|
||||
assert_file "Gemfile", %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["'],\s+branch:\s+["']master["']$}
|
||||
assert_file "Gemfile", %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["'],\s+branch:\s+["']main["']$}
|
||||
end
|
||||
|
||||
def test_spring
|
||||
|
|
|
@ -225,7 +225,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
|
|||
run_generator_instance
|
||||
|
||||
assert_empty @bundle_commands
|
||||
assert_file "Gemfile", %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["']$}
|
||||
assert_file "Gemfile", %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["'],\s+branch:\s+["']main["']$}
|
||||
end
|
||||
|
||||
def test_generation_does_not_run_bundle_install_with_full_and_mountable
|
||||
|
|
Loading…
Reference in a new issue