class User < ApplicationRecord has_many :agencies has_many :agents, through: :agencies, source: :agent end