Skip to content

Commit 25b2385

Browse files
authored
Fix association_basics.md
In this section the relation was renamed `:writer` so we need to reflect that in the examples.
1 parent ad41f71 commit 25b2385

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

guides/source/association_basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ recognize the bi-directional association. This can cause your application to:
950950
```irb
951951
irb> author = Author.first
952952
irb> author.books.any? do |book|
953-
irb> book.author.equal?(author) # This executes an author query for every book
953+
irb> book.writer.equal?(author) # This executes an author query for every book
954954
irb> end
955955
=> false
956956
```
@@ -960,10 +960,10 @@ recognize the bi-directional association. This can cause your application to:
960960
```irb
961961
irb> author = Author.first
962962
irb> book = author.books.first
963-
irb> author.name == book.author.name
963+
irb> author.name == book.writer.name
964964
=> true
965965
irb> author.name = "Changed Name"
966-
irb> author.name == book.author.name
966+
irb> author.name == book.writer.name
967967
=> false
968968
```
969969

0 commit comments

Comments
 (0)