why not: where("lower(?) like %?%", :name, value.downcase).

Also, I really dislike text searches in sql. But I guess, this is acceptable.