我已经关联了两个模型问题和答案,问题模型有很多答案,所以我的查询是
Question.joins("inner join answers on questions.correct_answer_id = answers.id").select("answers.answer")
SELECT answers.answer FROM `questions` inner join answers on questions.correct_answer_id = answers.id
在 mysql 查询中返回正确答案,但为什么是 rails?我只有
[#<Question >, #<Question >]