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 :)