RubyMine 2016.3 Help

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

  1. 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.
  2. In the editor, add relationship statements to the respective classes. For example:
    class Owner < ActiveRecord::Base essible :first_name, :last_name, :pet_name has_many :pets end ActiveRecord::Base essible :age, :nickname, :species, :owner belongs_to :owner end
  3. Switch to the Model Dependency diagram, and see the relationship links between the models, with edge labels.
    /help/img/idea/2016.3/rm_model_relationship_links.png
Last modified: 30 November 2016