Rails allows you to define associations between tables that are related to each other. Track Magic understands the most common type of association, has many/belongs to, and can help you set up and use this type of association.
When creating a new table (or adding fields to an existing table) a Belongs_To menu appears in the menu bar. This menu contains a list of the other tables in the application.
Choosing a table from this menu adds an _id field to the table being created or modified (for example office_id, product_id, etc.). This creates an association between the current table and the table you have chosen from the menu. When you press the Create Table or Modify Table button Track Magic adds the field to the table, and also modifies the class definition for both tables involved to include the proper has_many/ belongs_to declarations. In other words, Track Magic will automatically set up the association for you.
As an example, suppose you have two tables in your database called employees and offices. You'd like to associate each employee with a particular office. To do this first select the employees table in the Track Magic window. Then choose Add/Remove Fields from the Application menu (if you hadn't created the employees table yet you would use the Create New Rails Table command instead). With the dialog still open, pull down the Belongs_To menu and select offices (of course you must have already created the offices table).
This adds a new field to the employees table named office_id.
Make any other changes you want to make to the table structure, then press the Modify Table button. Track Magic will add the new office_id field to the table (along with any others you specified).
Track Magic will also modify the office and employee models with the code necessary to establish this new association.
That's it. The association is ready to go. See Working with Has Many / Belongs To Associations to learn how to interact with associations within Track Magic.