<file_sep>class Stroll < ApplicationRecord
belongs_to :dog, optional: true
belongs_to :dogsitter, optional: true
 
end
<file_sep>class Dogsitter < ApplicationRecord
  has_many :strolls
  has_many :dogs ,through: :strolls
  belongs_to :cities, optional: true 
end
<file_sep>class Dog < ApplicationRecord
has_many :strolls
has_many :dogsitters ,through: :strolls
belongs_to :cities, optional: true 
end
<file_sep>class AddStrollAsTableJoin < ActiveRecord::Migration[5.2]
  def change
add_reference :strolls, :dog, foreign_key: true
add_reference :strolls, :dogsitter, foreign_key: true 


  end
end
