0

"select * from users, award where (users.id = award.user_id) and award.trophy_id not in (select award.trophy_id from award where award.trophy_id = #{trophy.id})"

4

1 に答える 1

0

自分の質問に答えました:

named_scope :not_awarded_trophy, lambda {|トロフィー| { :include => :awards, :conditions => [ "awards.trophy_id not in (awards.trophy_id = ?)", trophy.id ] } }

于 2010-03-19T15:46:37.603 に答える