Skip to content

Commit 9badb0f

Browse files
Merge pull request rails#45438 from willnet/fix-sample-code-about-allow_deprecated_singular_associations_name
Fix wrong sample code about allow_deprecated_singular_associations_name [ci-skip]
2 parents 630342e + 90b3f69 commit 9badb0f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

guides/source/configuring.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,15 +1037,15 @@ before,
10371037
10381038
```ruby
10391039
class Post
1040-
self.table_name = "blog_posts"
10411040
end
10421041
10431042
class Comment
10441043
belongs_to :post
10451044
end
10461045
1047-
Comment.join(:post).where(posts: { id: 1 }) # deprecated if the table name is not `posts`
1048-
Comment.join(:post).where(post: { id: 1 }) # instead use the relation's name
1046+
post = Post.first
1047+
Comment.where(posts: post) # deprecated
1048+
Comment.where(post: post) # instead use the relation's name
10491049
```
10501050

10511051
#### `ActiveRecord::ConnectionAdapters::Mysql2Adapter.emulate_booleans`

0 commit comments

Comments
 (0)