I want to search a table for a list of pair values. Ex. This is an array of first and last names.
array = [['jane','doe'],['jack','chen'],['jane','ty'],['mike','ji'],['mike','smith']] I want to search the User table for each one of these combinations. Currently, I can only think of running a query per combination.
array.each do |a| User.where("firstname like (?) and lastname like (?)",a[0],a[1]) end Is there any way of running all the queries in a single query? Maintaining the combinations is required.