0

“从用户中选择*,奖励其中(users.id = Awards.user_id)和awards.trophy_id不在(从awards.trophy_id = #{trophy.id}的奖励中选择awards.trophy_id)”

4

1 回答 1

0

回答了自己的问题:

命名范围:not_awarded_trophy,lambda { |奖杯| { :include => :awards, :conditions => [ "awards.trophy_id 不在(从 Awards where Awards.trophy_id = ?) 中选择 Awards.trophy_id", trophy.id ] } }

于 2010-03-19T15:46:37.603 回答