diff options
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_record_querying.md | 2 | ||||
-rw-r--r-- | guides/source/active_support_instrumentation.md | 1 | ||||
-rw-r--r-- | guides/source/configuring.md | 3 | ||||
-rw-r--r-- | guides/source/contributing_to_ruby_on_rails.md | 52 | ||||
-rw-r--r-- | guides/source/form_helpers.md | 4 |
5 files changed, 18 insertions, 44 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index 91cc175095..02055e59f0 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -1261,7 +1261,7 @@ articles, all the articles would still be loaded. By using `joins` (an INNER JOIN), the join conditions **must** match, otherwise no records will be returned. -NOTE: If an association is eager loaded as part of a join, any fields from a custom select clause will not present be on the loaded models. +NOTE: If an association is eager loaded as part of a join, any fields from a custom select clause will not be present on the loaded models. This is because it is ambiguous whether they should appear on the parent record, or the child. Scopes diff --git a/guides/source/active_support_instrumentation.md b/guides/source/active_support_instrumentation.md index 69c6a6e414..9963125fa2 100644 --- a/guides/source/active_support_instrumentation.md +++ b/guides/source/active_support_instrumentation.md @@ -467,6 +467,7 @@ Active Job | `:job` | Job object | | `:adapter` | QueueAdapter object processing the job | | `:error` | The error that caused the retry | +| `:wait` | The delay of the retry | ### perform_start.active_job diff --git a/guides/source/configuring.md b/guides/source/configuring.md index e372b3a816..18a377a02e 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -1014,7 +1014,6 @@ If you choose to use MySQL or MariaDB instead of the shipped SQLite3 database, y ```yaml development: adapter: mysql2 - encoding: utf8 database: blog_development pool: 5 username: root @@ -1024,6 +1023,8 @@ development: If your development database has a root user with an empty password, this configuration should work for you. Otherwise, change the username and password in the `development` section as appropriate. +NOTE: If your MySQL version is 5.5 or 5.6 and want to use the `utf8mb4` character set by default, please configure your MySQL server to support the longer key prefix by enabling `innodb_large_prefix` system variable. + Advisory Locks are enabled by default on MySQL and are used to make database migrations concurrent safe. You can disable advisory locks by setting `advisory_locks` to `false`: ```yaml diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md index b5e40aa40f..e2493ad5f6 100644 --- a/guides/source/contributing_to_ruby_on_rails.md +++ b/guides/source/contributing_to_ruby_on_rails.md @@ -488,18 +488,10 @@ Navigate to the Rails [GitHub repository](https://github.com/rails/rails) and pr Add the new remote to your local repository on your local machine: ```bash -$ git remote add mine https://github.com/<your user name>/rails.git +$ git remote add fork https://github.com/<your user name>/rails.git ``` -Push to your remote: - -```bash -$ git push mine my_new_branch -``` - -You might have cloned your forked repository into your machine and might want to add the original Rails repository as a remote instead, if that's the case here's what you have to do. - -In the directory you cloned your fork: +You may have cloned your local repository from rails/rails or you may have cloned from your forked repository. To avoid ambiguity the following git commands assume that you have made a "rails" remote that points to rails/rails. ```bash $ git remote add rails https://github.com/rails/rails.git @@ -516,23 +508,17 @@ Merge the new content: ```bash $ git checkout master $ git rebase rails/master +$ git checkout my_new_branch +$ git rebase rails/master ``` Update your fork: ```bash -$ git push origin master -``` - -If you want to update another branch: - -```bash -$ git checkout branch_name -$ git rebase rails/branch_name -$ git push origin branch_name +$ git push fork master +$ git push fork my_new_branch ``` - ### Issue a Pull Request Navigate to the Rails repository you just pushed to (e.g. @@ -582,29 +568,15 @@ branches, squashing makes it easier to revert bad commits, and the git history can be a bit easier to follow. Rails is a large project, and a bunch of extraneous commits can add a lot of noise. -In order to do this, you'll need to have a git remote that points at the main -Rails repository. This is useful anyway, but just in case you don't have it set -up, make sure that you do this first: - -```bash -$ git remote add upstream https://github.com/rails/rails.git -``` - -You can call this remote whatever you'd like, but if you don't use `upstream`, -then change the name to your own in the instructions below. - -Given that your remote branch is called `my_pull_request`, then you can do the -following: - ```bash -$ git fetch upstream -$ git checkout my_pull_request -$ git rebase -i upstream/master +$ git fetch rails +$ git checkout my_new_branch +$ git rebase -i rails/master < Choose 'squash' for all of your commits except the first one. > < Edit the commit message to make sense, and describe all your changes. > -$ git push origin my_pull_request -f +$ git push fork my_new_branch -f ``` You should be able to refresh the pull request on GitHub and see that it has @@ -620,7 +592,7 @@ you can force push to your branch on GitHub as described earlier in squashing commits section: ```bash -$ git push origin my_pull_request -f +$ git push fork my_new_branch -f ``` This will update the branch and pull request on GitHub with your new code. Do @@ -632,7 +604,7 @@ note that using force push may result in commits being lost on the remote branch If you want to add a fix to older versions of Ruby on Rails, you'll need to set up and switch to your own local tracking branch. Here is an example to switch to the 4-0-stable branch: ```bash -$ git branch --track 4-0-stable origin/4-0-stable +$ git branch --track 4-0-stable rails/4-0-stable $ git checkout 4-0-stable ``` diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index 3660772fb9..b5e2c49487 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -775,7 +775,7 @@ You might want to render a form with a set of edit fields for each of a person's <%= form_with model: @person do |person_form| %> <%= person_form.text_field :name %> <% @person.addresses.each do |address| %> - <%= person_form.fields_for address, index: address.id do |address_form|%> + <%= person_form.fields_for address, index: address.id do |address_form| %> <%= address_form.text_field :city %> <% end %> <% end %> @@ -972,7 +972,7 @@ This form allows users to remove addresses: <ul> <%= f.fields_for :addresses do |addresses_form| %> <li> - <%= addresses_form.check_box :_destroy%> + <%= addresses_form.check_box :_destroy %> <%= addresses_form.label :kind %> <%= addresses_form.text_field :kind %> ... |