• R
    Allow `unscope` to be aware of table name qualified values · 5136277f
    Ryuta Kamizono 提交于
    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>
    5136277f
query_methods.rb 48.6 KB