次の3つのデータベーステーブルがあります。
Products
########
id
title
artist_id
Arists
######
id
profile
person_id
People
######
id
first_name
last_name
私のモデルでは、アーティストの商品と一緒にProduct
商品を返品するメソッドを作成するにはどうすればよいですか?title
first_name
次のモデルの関連付けを設定しました。
Product belongs to Artist
Artist belongs to Person