I have a entity in my database that have multiple fields. I need search in this entity based if a certain input it's contained in certain fields, by example
Entity Car
- model_name
- owner
I want search like this (a pseudo sql idea)
Select * FROM Car WHERE (LIKE model_name = "%maz%" OR LIKE owner = "%maz%")
I've tried with the find method but it's not work
searched_string = "%maz%"
Car.find(:all, :conditions => {model_name: searched_string, owner: searched_string})
How to achieve this?