我有以下三个数据库表:
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