1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

3 commits

Author SHA1 Message Date
Jorge Manrubia
e10e6ab1d4
Make .excluding work when no arguments are passed
The change from https://github.com/rails/rails/pull/41465 was a
breaking change. Before, `.without` was delegated to `Array` and worked
with empty arguments. This change restores that old behavior.
2021-03-03 07:48:57 -05:00
Ashik Salman
3317e9913e Added #without as alias for #excluding. 2021-02-17 01:11:14 +05:30
Glen Crawford
690fdbb2b9 Implemented ActiveRecord::Relation#excluding method.
This method excludes the specified record (or collection of records) from the resulting relation.

For example: `Post.excluding(post)`, `Post.excluding(post_one, post_two)`, and `post.comments.excluding(comment)`.

This is short-hand for `Post.where.not(id: post.id)` (for a single record) and `Post.where.not(id: [post_one.id, post_two.id])` (for a collection).
2021-02-17 00:16:09 +11:00