0
Course.find(:all,:group =>:id,:order =>'updated_at DESC',:joins =>:students:conditions => {:students => {:first_name = > 「約翰」:狀態=> 1}})rails將哈希條件加入
尋找這個查詢,傳遞條件的哈希,還有一個辦法:
- 構造,其中:FIRST_NAME沒有空?
- 構造一個where:first_name!=「John」?