@@ -217,7 +217,7 @@ then you should use `has_one` instead.
217217
218218When used alone, ` belongs_to ` produces a one-directional one-to-one
219219relationship. Therefore each book in the above example "knows" its author, but
220- the authors don't know about their books. To setup a [ bi-directional
220+ the authors don't know about their books. To set up a [ bi-directional
221221association] ( #bi-directional-associations ) - use ` belongs_to ` in combination
222222with a ` has_one ` or ` has_many ` on the other model, in this case the Author
223223model.
@@ -560,7 +560,7 @@ the associated object's foreign key to the same value.
560560
561561The ` build_association ` method returns a new object of the associated type. This
562562object will be instantiated from the passed attributes, and the link through
563- this objects foreign key will be set, but the associated object will _ not_ yet
563+ this object's foreign key will be set, but the associated object will _ not_ yet
564564be saved.
565565
566566``` ruby
@@ -1599,7 +1599,7 @@ Similarly, you can retrieve a collection of pictures from an instance of the
15991599Additionally, if you have an instance of the ` Picture ` model, you can get its
16001600parent via ` @picture.imageable ` , which could be an ` Employee ` or a ` Product ` .
16011601
1602- To setup a polymorphic association manually you would need to declare both a
1602+ To set up a polymorphic association manually you would need to declare both a
16031603foreign key column (` imageable_id ` ) and a type column (` imageable_type ` ) in the
16041604model:
16051605
@@ -1869,7 +1869,7 @@ end
18691869class Car < Vehicle
18701870end
18711871
1872- Car .create
1872+ Car .create( color: " Red " , price: 10000 )
18731873# => #<Car kind: "Car", color: "Red", price: 10000>
18741874```
18751875
@@ -1890,7 +1890,7 @@ class Vehicle < ApplicationRecord
18901890 self .inheritance_column = nil
18911891end
18921892
1893- Vehicle .create!(type: " Car" )
1893+ Vehicle .create!(type: " Car" , color: " Red " , price: 10000 )
18941894# => #<Vehicle type: "Car", color: "Red", price: 10000>
18951895```
18961896
@@ -1914,8 +1914,7 @@ includes all attributes of all subclasses in a single table.
19141914
19151915A disadvantage of this approach is that it can result in table bloat, as the
19161916table will include attributes specific to each subclass, even if they aren't
1917- used by others. This can be solved by using [ `Delegated
1918- Types`] ( #delegated-types ) .
1917+ used by others. This can be solved by using [ ` Delegated Types ` ] ( #delegated-types ) .
19191918
19201919Additionally, if you’re using [ polymorphic
19211920associations] ( #polymorphic-associations ) , where a model can belong to more than
0 commit comments