I have a model called Author. An author has many Articles.
Articles have a scope called .published that does: where(published: true).
I want to load the author, with the published articles.
I tried:
Author.includes(:articles.published).find(params[:…
I already have a working solution, but I would really like to know why this doesn't work:
ratings = Model.select(:rating).uniq
ratings.each { |r| puts r.rating }
It selects, but don't print unique values, it prints all values, including …