Mega Code Archive

 
Categories / Ruby / Active Record
 

Find with OR

Account.find :all, :conditions => [ "updated_on > ? OR id IN (?)",                                     @last_update,                                     [ 2, 3, 5, 7, 11 ] ] It will result in the following SQL: SELECT *   FROM accounts   WHERE     updated_on > '20061214 15:29:12'     OR id IN (2, 3, 5, 7, 11)