## *Usage*

For testing purposes I'd say it would be useful to have 
`#where_values_hash` return the `not` conditions too in either:

* a separate method (`#where_not_values_hash`),
* by modifying the currently returned hash's structure from 
`#where_values_hash`.


## *Relevant code parts*

Current Rails 4.2.5 implementation - 
https://github.com/rails/rails/blob/4-2-5/activerecord/lib/active_record/relation.rb#L560
 

Current Rails 5.x.x implementation - 
https://github.com/rails/rails/blob/master/activerecord/lib/active_record/relation/where_clause.rb#L48



## *Examples*

Example that returns `not` conditions in `#where_values_hash` :

```Ruby
> User.where(active: true).where.not(name: 'joe').where_values_hash

=> {"positive" => {"active": true}, "negative" => {"name": "joe"} }
```

Example that returns `not` conditions in new method 
`#where_not_values_hash`:

```Ruby
> User.where(active: true).where.not(name: 'joe').where_not_values_hash

=> {"name": "joe"} 
```

## *Closure*

If you agree with this idea, I'll gladly work on a PR.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to