fix bug in search after rails 3 upgrade