Q:

Query postgres integer array with Rails where values are not nil

I'm trying to build a scope for my Contradiction model where the evaluation_parameters attribute only contains non NULL values.
I have records where this attribute is completely empty {} or where one of the two values is nil {123, NULL} and I would like to not have these in my result.
Here is my migration: 
add_column :contradictions, :evaluation_parameters, :integer, array: true, default: []

I already tried the following query which returns only records with an empty array
Contradiction.all.where.not("NULL = ANY (evaluation_parameters)")

Any suggestions  on how I could do this ?
Thank you :)

A:

I found an answer here Check if NULL exists in Postgres array
My final query looks like this :
Contradiction.where.not(evaluation_parameters: '{}').where.not("-1 = ANY(evaluation_parameters) IS NULL")

