granite
granite copied to clipboard
Move finders to new query builder
There are several finder methods that need to be moved to use the new query builder:
- count
- first
- first!
- find
- find!
- find_by
- find_by!
- find_each
- find_in_batches
- all
Also, We need to move the Collection
and AssociationCollection
with it's finders that allows for queries to be built off of the belongs_to
and has_many
relationships. It provides lazy querying so it only performs the query when the Collection
is accessed.
@drujensen Do you want help with this? I'd like to help out with Granite
@ilanusse I believe this is an open call for pull requests, yes. As a first contribution, my recommendation would be to choose one or two of the listed methods at most. Thanks for diving in!
I'm not sure if this request is out of place, but it seems to go along with adding finders to the associations -- can we add order
to the list?
Being able to do user.posts.order(created_at: :desc)
instead of Post.where(user_id: user.id).order(created_at: :desc)
seems logical.