Skip to content

Commit 90b3f69

Browse files
committed
Fix wrong sample code about allow_deprecated_singular_associations_name [skip ci]
The only time rails#45163 and rails#45344 have an effect is when the hash value passed to `where` is a model object. The current sample code does not change behavior between Rails 7.0 and 7.1
1 parent 2f5dcb7 commit 90b3f69

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)