Say I have the following in my console:
@user.favcolors
=> [#<FavColors id: 1, color_id: 18, fav_id: 1>,
#<FavColors id: 2, color_id: 19, fav_id: 1>]
@user.favcolors.count
=> 2
However, since fav_id is same in both results (1). I want this count to be 1, instead of 2.
Is there a way I can put where
clause in the code @user.favcolors
?