diff --git a/.github/stale.yml b/.github/stale.yml index 399c5de933a7c..971969c665bcb 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3cabc57bb2041..e2d6bf0e2b445 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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). diff --git a/README.md b/README.md index 884f6710c29a5..04e242e0d0120 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ are bundled together in [Action Pack](actionpack/README.rdoc). The _**View layer**_ is composed of "templates" that are responsible for providing appropriate representations of your application's resources. Templates can come in a variety of formats, but most view templates are HTML with embedded -Ruby code (ERB files). Views are typically rendered to generate a controller response +Ruby code (ERB files). Views are typically rendered to generate a controller response or to generate the body of an email. In Rails, View generation is handled by [Action View](actionview/README.rdoc). ## Frameworks and libraries @@ -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 diff --git a/RELEASING_RAILS.md b/RELEASING_RAILS.md index e5e3c9f91e539..f48f24ac6a846 100644 --- a/RELEASING_RAILS.md +++ b/RELEASING_RAILS.md @@ -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. diff --git a/actionmailer/README.rdoc b/actionmailer/README.rdoc index f9c84b4232c8f..d55459de86fc3 100644 --- a/actionmailer/README.rdoc +++ b/actionmailer/README.rdoc @@ -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 diff --git a/actionpack/README.rdoc b/actionpack/README.rdoc index 67d0c62a84815..30b52efb37c52 100644 --- a/actionpack/README.rdoc +++ b/actionpack/README.rdoc @@ -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 diff --git a/actionview/README.rdoc b/actionview/README.rdoc index 388aa4ff7b113..fcc43c4eeeb29 100644 --- a/actionview/README.rdoc +++ b/actionview/README.rdoc @@ -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 diff --git a/actionview/app/assets/javascripts/rails-ujs/BANNER.js b/actionview/app/assets/javascripts/rails-ujs/BANNER.js index 47ecd66003a1b..6a48891886d73 100644 --- a/actionview/app/assets/javascripts/rails-ujs/BANNER.js +++ b/actionview/app/assets/javascripts/rails-ujs/BANNER.js @@ -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 */ diff --git a/actionview/package.json b/actionview/package.json index fac1d260df29d..91ab13d980f97 100644 --- a/actionview/package.json +++ b/actionview/package.json @@ -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": { diff --git a/activejob/README.md b/activejob/README.md index 4cb53e469cfe5..6bcf68d608a26 100644 --- a/activejob/README.md +++ b/activejob/README.md @@ -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 diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc index 8fd7ed7ed8c35..f68c5bfcd04db 100644 --- a/activemodel/README.rdoc +++ b/activemodel/README.rdoc @@ -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 diff --git a/activerecord/README.rdoc b/activerecord/README.rdoc index f98076ccd359b..306982d17b7cd 100644 --- a/activerecord/README.rdoc +++ b/activerecord/README.rdoc @@ -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 diff --git a/activestorage/README.md b/activestorage/README.md index 6fe95d9382a31..b5bca0af26600 100644 --- a/activestorage/README.md +++ b/activestorage/README.md @@ -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). diff --git a/activesupport/README.rdoc b/activesupport/README.rdoc index c56e63fa85ced..c2df6d73b2751 100644 --- a/activesupport/README.rdoc +++ b/activesupport/README.rdoc @@ -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 diff --git a/guides/bug_report_templates/action_controller_master.rb b/guides/bug_report_templates/action_controller_main.rb similarity index 94% rename from guides/bug_report_templates/action_controller_master.rb rename to guides/bug_report_templates/action_controller_main.rb index 682269163a0e2..ba3c5c80896b2 100644 --- a/guides/bug_report_templates/action_controller_master.rb +++ b/guides/bug_report_templates/action_controller_main.rb @@ -7,7 +7,7 @@ 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" diff --git a/guides/bug_report_templates/action_mailbox_master.rb b/guides/bug_report_templates/action_mailbox_main.rb similarity index 97% rename from guides/bug_report_templates/action_mailbox_master.rb rename to guides/bug_report_templates/action_mailbox_main.rb index 303d7d5222971..15d48c83209c8 100644 --- a/guides/bug_report_templates/action_mailbox_master.rb +++ b/guides/bug_report_templates/action_mailbox_main.rb @@ -7,7 +7,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } - gem "rails", github: "rails/rails" + gem "rails", github: "rails/rails", branch: "main" gem "sqlite3" end diff --git a/guides/bug_report_templates/active_job_master.rb b/guides/bug_report_templates/active_job_main.rb similarity index 89% rename from guides/bug_report_templates/active_job_master.rb rename to guides/bug_report_templates/active_job_main.rb index ae3ef7752fdff..335a78f392e5a 100644 --- a/guides/bug_report_templates/active_job_master.rb +++ b/guides/bug_report_templates/active_job_main.rb @@ -7,7 +7,7 @@ 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" diff --git a/guides/bug_report_templates/active_record_master.rb b/guides/bug_report_templates/active_record_main.rb similarity index 94% rename from guides/bug_report_templates/active_record_master.rb rename to guides/bug_report_templates/active_record_main.rb index 780456b7b6033..f8acbabfa3b2f 100644 --- a/guides/bug_report_templates/active_record_master.rb +++ b/guides/bug_report_templates/active_record_main.rb @@ -7,7 +7,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } - gem "rails", github: "rails/rails" + gem "rails", github: "rails/rails", branch: "main" gem "sqlite3" end diff --git a/guides/bug_report_templates/active_record_migrations_master.rb b/guides/bug_report_templates/active_record_migrations_main.rb similarity index 96% rename from guides/bug_report_templates/active_record_migrations_master.rb rename to guides/bug_report_templates/active_record_migrations_main.rb index b0fe3bc66017c..61e9c75345520 100644 --- a/guides/bug_report_templates/active_record_migrations_master.rb +++ b/guides/bug_report_templates/active_record_migrations_main.rb @@ -7,7 +7,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } - gem "rails", github: "rails/rails" + gem "rails", github: "rails/rails", branch: "main" gem "sqlite3" end diff --git a/guides/bug_report_templates/active_storage_master.rb b/guides/bug_report_templates/active_storage_main.rb similarity index 96% rename from guides/bug_report_templates/active_storage_master.rb rename to guides/bug_report_templates/active_storage_main.rb index 6697b41133af6..942726490d270 100644 --- a/guides/bug_report_templates/active_storage_master.rb +++ b/guides/bug_report_templates/active_storage_main.rb @@ -7,7 +7,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } - gem "rails", github: "rails/rails" + gem "rails", github: "rails/rails", branch: "main" gem "sqlite3" end diff --git a/guides/bug_report_templates/generic_master.rb b/guides/bug_report_templates/generic_main.rb similarity index 87% rename from guides/bug_report_templates/generic_master.rb rename to guides/bug_report_templates/generic_main.rb index ec65fee29281c..576b95e108f1b 100644 --- a/guides/bug_report_templates/generic_master.rb +++ b/guides/bug_report_templates/generic_main.rb @@ -7,7 +7,7 @@ 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" diff --git a/guides/source/4_0_release_notes.md b/guides/source/4_0_release_notes.md index 1caf066a1066a..15c628a502035 100644 --- a/guides/source/4_0_release_notes.md +++ b/guides/source/4_0_release_notes.md @@ -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. diff --git a/guides/source/6_1_release_notes.md b/guides/source/6_1_release_notes.md index ff09d80e5d6af..4a631fe0e1f97 100644 --- a/guides/source/6_1_release_notes.md +++ b/guides/source/6_1_release_notes.md @@ -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 diff --git a/guides/source/6_2_release_notes.md b/guides/source/6_2_release_notes.md index f3cfb56f0c16a..728f6f88f7943 100644 --- a/guides/source/6_2_release_notes.md +++ b/guides/source/6_2_release_notes.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 diff --git a/guides/source/_welcome.html.erb b/guides/source/_welcome.html.erb index 77f1ac79f8d49..2f5c79e8aa54f 100644 --- a/guides/source/_welcome.html.erb +++ b/guides/source/_welcome.html.erb @@ -2,7 +2,7 @@ <% if @edge %>

- These are Edge Guides, based on master@<%= @edge[0, 7] %>. + These are Edge Guides, based on main@<%= @edge[0, 7] %>.

If you are looking for the ones for the stable version, please check diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 8be71f6258f7f..2f3da94944ae1 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -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. diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md index 26d5fba6d8d5c..4ed259c2e28c4 100644 --- a/guides/source/active_storage_overview.md +++ b/guides/source/active_storage_overview.md @@ -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. diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md index dcaf691d51a48..e0b0e6d1e39c2 100644 --- a/guides/source/contributing_to_ruby_on_rails.md +++ b/guides/source/contributing_to_ruby_on_rails.md @@ -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! diff --git a/guides/source/i18n.md b/guides/source/i18n.md index 29ab45b2e496a..1c5f4e0206bad 100644 --- a/guides/source/i18n.md +++ b/guides/source/i18n.md @@ -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 ------------------------------------- diff --git a/guides/source/kindle/rails_guides.opf.erb b/guides/source/kindle/rails_guides.opf.erb index 1882ec100538b..83d00cfc2eef4 100644 --- a/guides/source/kindle/rails_guides.opf.erb +++ b/guides/source/kindle/rails_guides.opf.erb @@ -5,7 +5,7 @@ - Ruby on Rails Guides (<%= @version || "master@#{@edge[0, 7]}" %>) + Ruby on Rails Guides (<%= @version || "main@#{@edge[0, 7]}" %>) en-us Ruby on Rails diff --git a/guides/source/layout.html.erb b/guides/source/layout.html.erb index 95c00a4ad03b4..cc89e47b9da36 100644 --- a/guides/source/layout.html.erb +++ b/guides/source/layout.html.erb @@ -102,9 +102,9 @@

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.

diff --git a/guides/source/maintenance_policy.md b/guides/source/maintenance_policy.md index f117dc23daf8f..0b138d9fd6af2 100644 --- a/guides/source/maintenance_policy.md +++ b/guides/source/maintenance_policy.md @@ -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 diff --git a/guides/source/security.md b/guides/source/security.md index 48e35736f1b02..84674173ec5b1 100644 --- a/guides/source/security.md +++ b/guides/source/security.md @@ -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 diff --git a/guides/source/working_with_javascript_in_rails.md b/guides/source/working_with_javascript_in_rails.md index 24c77dd45b6e8..e95a08974c64e 100644 --- a/guides/source/working_with_javascript_in_rails.md +++ b/guides/source/working_with_javascript_in_rails.md @@ -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) diff --git a/railties/README.rdoc b/railties/README.rdoc index 26404743c420a..13270dd4249e8 100644 --- a/railties/README.rdoc +++ b/railties/README.rdoc @@ -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 diff --git a/railties/lib/rails/api/task.rb b/railties/lib/rails/api/task.rb index 489820f600327..6f30eda23cd15 100644 --- a/railties/lib/rails/api/task.rb +++ b/railties/lib/rails/api/task.rb @@ -189,7 +189,7 @@ def api_dir class EdgeTask < RepoTask def rails_version - "master@#{`git rev-parse HEAD`[0, 7]}" + "main@#{`git rev-parse HEAD`[0, 7]}" end end diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 9152f2003f1a1..b41c0adcf40e8 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -98,7 +98,7 @@ def self.add_shared_options_for(name) 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 @@ def rails_gemfile_entry ] 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 diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 60f5b6b8d2568..82a17b9755e34 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -857,7 +857,7 @@ def test_edge_option 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 @@ def test_master_option 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 diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index 6f91011855603..31eec0b361d1e 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -225,7 +225,7 @@ def test_edge_option 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