granite icon indicating copy to clipboard operation
granite copied to clipboard

Move finders to new query builder

Open drujensen opened this issue 5 years ago • 3 comments

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 avatar Oct 15 '18 05:10 drujensen

@drujensen Do you want help with this? I'd like to help out with Granite

ilanusse avatar Dec 03 '18 15:12 ilanusse

@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!

robacarp avatar Dec 04 '18 21:12 robacarp

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.

kevinelliott avatar Jan 30 '19 21:01 kevinelliott