```ruby
term = "%#{q}%"
where(["first_name LIKE ? or last_name LIKE ? or concat(first_name, ' ', last_name) like ?", term, term, term ])
```