I think, first of all, it is better to use a second desk phone from the customer_id, phone_number field. I think this is more rails). So you can use this query
Phone.where("phone_number LIKE ?", '%PART%').first.customer
If you serialize your array in some text field, such as JSON, you should use% on both sides of your template:
Customer.where('phones LIKE ?', '%+7985%')
If you have an array in your database, you should use the unsest () function to expand the array to a rowset.
source share