joins and includes

User.joins(:user_corps).where("user_corps.corp_id in (?) and user_corps.is_onjob = ?", [1,3,5],1).order('user_corps.id desc')


 
Event.includes(:category).where( :category => { :position => 1 } )
posted on 2014-04-03 16:21  qinyan20  阅读(130)  评论(0编辑  收藏  举报