I have a model “Theme” which has_and_belongs_to_many “Lessons”.
I need to get the (db) id of the lessons through the theme.
For instance, if in irb I write something like this :
test = Theme.find(:first)
I get the ID of test (the theme) and not of the lesson.
Do you know how to get the id of the nested object instead ?