You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes [#408][]
Introduce a simple chainable `WhereClause` class inspired by [Active
Record][].
All methods (including those that integrate with [Enumerable][]) are
delegated to `WhereClause#all`, which itself delegates to `Base.find`.
By merging parameters through `.where`-chaining, this commit supports
deferred fetching:
```ruby
people = Person.where(id: 2).where(name: "david")
# => GET /people.json?id=2&name=david
people = Person.where(id: 2).all(params: { name: "david" })
# => GET /people.json?id=2&name=david
people = Person.all(from: "/records.json").where(id: 2)
# => GET /records.json?id=2
```
[#408]: #408
[Active Record]: https://github.com/rails/rails/blob/main/activerecord/lib/active_record/relation/where_clause.rb
[Enumerable]: https://ruby-doc.org/3.4.1/Enumerable.html
0 commit comments