I have User
model with attribute full_name
. And I want users to search just by their first or last name.
I have tried
User.where("username= :username OR full_name LIKE :full_name", username: "rony", full_name: "rony")
But the problem is when I search with this only query, full_name will always return nill because this query only search exact "rony" in full_name instead of for example "rony sianturi", do you have any other suggestion in doing this query. Thank you.
I have search similar questions, but all other questions is the invese of this question. So no luck
Thank you.