aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-05-24 20:51:51 +0900
committerGitHub <noreply@github.com>2017-05-24 20:51:51 +0900
commit3a628b9338c436001c00a9865b22036abd44a2bd (patch)
tree1cb6574a64509a6bfce8d36dd2829e06f916084b /guides/source
parente5a9d289b16592f395fb528c9688604c02bd2e33 (diff)
parentd225f0b94c9d89e8837ee8e98ee3a7837877631b (diff)
downloadrails-3a628b9338c436001c00a9865b22036abd44a2bd.tar.gz
rails-3a628b9338c436001c00a9865b22036abd44a2bd.tar.bz2
rails-3a628b9338c436001c00a9865b22036abd44a2bd.zip
Merge pull request #29201 from willnet/fix-docs-has-one
[ci skip]fix wrong method name in docs
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/association_basics.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md
index 5794bfa666..d8e85497fa 100644
--- a/guides/source/association_basics.md
+++ b/guides/source/association_basics.md
@@ -599,7 +599,7 @@ class CreateBooks < ActiveRecord::Migration[5.0]
t.string :book_number
t.integer :author_id
end
-
+
add_index :books, :author_id
add_foreign_key :books, :authors
end
@@ -1417,7 +1417,7 @@ If either of these saves fails due to validation errors, then the assignment sta
If the parent object (the one declaring the `has_one` association) is unsaved (that is, `new_record?` returns `true`) then the child objects are not saved. They will automatically when the parent object is saved.
-If you want to assign an object to a `has_one` association without saving the object, use the `association.build` method.
+If you want to assign an object to a `has_one` association without saving the object, use the `build_association` method.
### `has_many` Association Reference