I have two models - Question & Tag
.
Both have a HABTM association between themselves. There is also a questions_tags
join table.
If I have a question (q
), I can find the tags by simply doing q.tags
.
But, if I have a tag (t
), when I try to go the other way (t.questions
), I get an error like this:
NoMethodError: undefined method `questions' for #<ActiveRecord::Relation:0x007fda147522b8>
Is HABTM not supposed to work both ways? How do I get the questions
associated with a tag in my case?