【发布时间】:2009-01-27 18:45:49
【问题描述】:
我有以下 Rails 定义:
Class Book
string title
has_many readings
has_many users, :through => :readings
Class Reader
int rating
belongs_to :book
belongs_to :user
Class User
has_many readings
has_many books, through => :readings
不,我想这样查询:
给我所有具有 book.title = "test" 的用户 A 的阅读评分
你能帮帮我吗?谢谢!
【问题讨论】:
标签: ruby-on-rails activerecord