0

i've a problem with finding all the nodes that are invalids. here's the class :

class MyNode
  include Neo4j::ActiveNode
  property :name
  property :is_valid, type: Integer, default: 0
end

When my nodes are created the property is not set automatically apparently. Then i want to search all the nodes that are invalids and it returns 0

classobject.as(:n).where(is_valid: [0,'']).count

i've tried with that as well

validates :is_valid, numericality: { only_integer: true }

how should i handle this ?

armedwing
  • 113
  • 1
  • 10

1 Answers1

0

i solved my problem by systematically adding is_valid: 0 to my parameters where it was created. i was thinking that as it has been set as default: 0 it would be automatically set

armedwing
  • 113
  • 1
  • 10