Fix query with nested array in Active Record

`User.where(id: [[1,2],3])` was equal to `User.where(id:[1, 2, 3])`
in Rails 4.1.x but because of some refactoring in Arel this stopped
working in 4.2.0. This fixes it in Rails. Fixes #16580.
[Dan Olson & Cristian Bica]

/cc @sgrif @matthewd @DanOlson @chancancode 
I lost the changes we've done yesterday with a little git fiasco :)It passes all the tests from yesterday in the current implementation. 

The uniq seems useful and I don't think it breaks backwards compatibility. 

I'll implement any feedback later today

On Sat, Sep 6, 2014 at 2:42 PM, Abdelkader Boudih
<notifications@github.com> wrote:

>> @@ -2,6 +2,14 @@ module ActiveRecord
>>    class PredicateBuilder
>>      class ArrayHandler # :nodoc:
>>        def call(attribute, value)
>> +
>> +        if value.any? { |val| val.is_a?(Array) }
>> +          ActiveSupport::Deprecation.warn "Passing a nested array to Active Record " \
>> +            "finder methods is deprecated and will be removed. Flatten your array " \
>> +            "before using it for 'IN' conditions."
>> +          value = value.flatten.uniq
>> +        end
> uniq is good in case the array contain duplicate value [1,2,3,5,6,7,[7,8,9],8]
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/rails/rails/pull/16825/files#r17208158