我習慣範圍where(address: [nil, ''], city: [nil, ''])
,我得到的請求如何在ActiveRecord Rails 4.1.1中使用OR?
WHERE ((`address`.`address` = '' OR `address`.`address` IS
NULL) AND (`address`.`city` = '' OR `address`.`city` IS
NULL))
我需要更換AND
到OR
。如何使用ActiveRecord構建查詢?
http://stackoverflow.com/questions/17192829/does-rails-4-have-support-for-or-queries – maicher