Creating Relationship Links Between Models
The Model Dependency diagram reflects links between the models, specified in the source code.
To show relationship links between models, follow these general steps
- Open for editing the desired model classes. You can do that by choosing a model class in the Rails view, or in the Model Dependency diagram, and pressing F4.
- In the editor, add relationship statements to the respective classes. For example:
classOwner < ActiveRecord::Baseattr_accessible:first_name,:last_name,:pet_namehas_many:petsend...classPet < ActiveRecord::Baseattr_accessible:age,:nickname,:species,:ownerbelongs_to:ownerend
- Switch to the Model Dependency diagram, and see the relationship links between the models, with edge labels.
Last modified: 1 September 2016