I have a simple query that I'm attempting to construct.
I want to pass in parameters to the query.
Product.where('id = ?', 1)
Easy as right.. What to do if the field list and the values are arrays
fields = ['id = ? ', 'type_id = ?', 'brand_id = ?']
values = [1, 1, 1]
Product.where(fields.join(' and '), values) #does not compute, does not compute!
Anyone know how to pass in the values for a parametrized query?