I need to create a method to search over a specific table `tournaments`, the method should search through the following columns :
- name
- address
- starts\_on
- ends\_on
- city
- postcode

I am unsure how to do that, so far I have written a class method in my tournament model that looks like that :

```
 def self.search(term)
    Tournament.where('name ILIKE ? OR starts_on ILIKE ? OR ends_on ILIKE ?' , "%#{term}%")
  end

```

How can I and what is the best way to do this ?