I'm just learning how to program in Ruby on Rails, and I'm really impressed by how much work the Ruby on Rails framework does for you. I have the following two classes:
Object
--------
object_id
description
ObjectGroup
--------
group_id
description
The idea is that I have some objects, and I'd like for the users to be able to define groups of Objects. Both Object rows and ObjectGroup rows these have their own identifiers and associated data, that's very intuitive based on the published documents on the web. My question is - how do I store information on the Objects that make up an ObjectGroup and make best use of the Ruby on Rails framework? The obvious way to do this in SQL was to make use of a third table that stored entries of the following form:
ObjectGroupEntry
--------
object_id
group_id
Each entry in the ObjectGroupEntry table represents an Object that is part of an ObjectGroup. Is it my responsibility to create this table manually and teach the classes that interact with Objects and ObjectGroups how to interact with it? Or does Ruby on Rails provide some magic to do this that I haven't found yet?
I could do this myself with what I know, but I'm still learning Ruby on Rails and I'd like to learn the Right Way (TM) to do this.