I have a model favorit_group (user:references, group:references).
And would like to find all the favorites groups of my User with something like that :
current_user.fav_groups
I suppose that i have to write something like this in my model User, but it's not working
has_many :favorit_groups, dependent: :destroy
has_many :fav_groups, through: :favorit_groups, class_name: "Group"
Is anyone who is working with this kind of association ? Or should I have to join and merge the model favorit_groups inside my User model ?