Hi! I hope someone can offer some insight or direction into a problem
In my application, I have two tables: products and reviews.
- Products stores information on things that are sold
- Reviews store comments from users that purchased the product, as well
as boolean field about if they would purchase again.
The models are setup so that products has_many reviews and reviews
belong_to their respective products.
So my question is this:
How can I structure a query so that I can order products based on the
number of people who would purchase it again?
It’d be alot easier for me, and probably my server, if I just kept a
running count of those in the actual product record, but I’m trying to
keep it dynamic so that I can create custom reviewer sets elsewhere.
Thanks in advance for any direction.