Allow `unscope` to be aware of table name qualified values
It is possible to unscope only the column in the specified table.
```ruby
posts = Post.joins(:comments).group(:"posts.hidden")
posts = posts.where("posts.hidden": false, "comments.hidden": false)
posts.count
# => { false => 10 }
# unscope both hidden columns
posts.unscope(where: :hidden).count
# => { false => 11, true => 1 }
# unscope only comments.hidden column
posts.unscope(where: :"comments.hidden").count
# => { false => 11 }
```
Co-authored-by: NSlava Korolev <korolvs@gmail.com>
Showing
想要评论请 注册 或 登录