There should also be a line for has_many :projects, through: :affiliations