HI guys.... I have an articles table with fields as id,ti

HI guys…

I have an articles table with fields as id,title, . . . and
users table with id,name, . . . and i can join this table to put a
through relation with readings table(A kind of join) with fields as
id, article_id, user_id, read_at, rating.

The relations will be like the below
class Article < ActiveRecord::Base
has_many :readings
end

class User < ActiveRecord::Base
has_many :readings
end

class Reading < ActiveRecord::Base
belongs_to :article
belongs_to :user
end

But the thing is i have a user, reading an article several times. So
when i am listing, it will show three entries of an user for three
readings. So i will use one of the two method
options :unique, :select=>“distinct.BlahBlah” to not repeat. So that
must make me to not have the repetitions. But my concern here is
regarding the ratings and the other field in my third table. The user
may have read an article three times but each and every time he might
have rated that article with different entries.

So if i unique the readings what will be the rating considered to
my rated_at.

Thanks In advance…