Skip to content

Commit 79df80b

Browse files
authored
Merge pull request rails#54153 from VitaliiShevchenko/XL_08012024
Improve `collection.create!` docs in the association basics guides [ci skip]
2 parents 1284513 + 1383fbc commit 79df80b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/source/association_basics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,8 +1395,8 @@ specified on the associated model, the associated object _will_ be saved.
13951395
@assembly = @part.assemblies.create({ assembly_name: "Transmission housing" })
13961396
```
13971397

1398-
Does the same as `collection.create`, but raises `ActiveRecord::RecordInvalid`
1399-
if the record is invalid.
1398+
`collection.create!` does the same as `collection.create`, but raises
1399+
`ActiveRecord::RecordInvalid` if the record is invalid.
14001400

14011401
The [`collection.reload`][] method returns a Relation of all of the associated
14021402
objects, forcing a database read. If there are no associated objects, it returns

0 commit comments

Comments
 (0)