I was advised to create a new question based on my previous one so here it is :
I have on my website a list of product, each user can create his own savings based on these products. So several users can create their own savings based on the same product. So when one user create a saving I add in the database a saving with the user_id and the product_id he refers to. Now, on one page I want to display all the savings from the other users (excluding current_user) but, as many user can create a saving based on the same product I want to display these only once.If several users create a saving based on product X I want it only displayed once,thanks
The saving table has these field :
id product_id user_id price saved
What I did is what is posted on this question : Squeel request and Heroku, Postgres: Error using GROUP BY and ORDER
I cannot get it working properly on heroku (postgres). If anyone can help me writing the query for Rails or for Squeel that would be awesome thanks !