I have three models of concern here:
The associations are as follows:
Key notes:
Here is the challenge. I want to create two associations in the Fight model:
The first must grab the records from the Punch model; however, it must only grab those records where Fight.challenger_id = FightPunch.user_id.
Same with #2, but just dealing with the challengee.
相关文档位于受支持的选项下,尤其是“ foreign_key”和“ primary_key”
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.