Question: A small and simple question, I have these 2 where example clauses:

```
Product.where("name = ? AND is_done = ?", "test",false)

Product.where(name:"test").where(is_done:false)

```

I would rather use the second one because its more readable and easier to add more where if I want, now my question is: Which one is faster, more secure and/or more recommended? 

Thanks for yout answers =)

Answer: 
This'll get the intersection, but id doesn't exactly use the funky `&` operator or sets.

```
def coffee(rest)
  acceptable_coffee = ["dark", "blend", "handsome"]
  rest.select { |name| acceptable_coffee.include? name.downcase }
end

```
I always turn to regular expression when I want to select strings that match a pattern.

```
def coffee(arr)
  acceptable_coffee = /\A(?:dark|blend|handsome)\z/i
  good_coffee = arr.grep(acceptable_coffee)
end

arr1 = ["dark", "decaf", "java", "HANDSOME"]
arr2 = ["dark", "smooth", "BLEND"]

coffee(arr1)  #=> ["dark", "HANDSOME"]
coffee(arr2)  #=> ["dark", "BLEND"]

```

Explain about the regexp `/\A(?:dark|blend|handsome)\z/i`:

`\A` matches the beginning of a string (before the first character).  

`(?:)` is a non-capture group, where I can put `|`.  

`|` reads "or".  

`\z` matches the end of a string (after the last character).  

The trailing `i` outside `/.../` means ignore case.