Node.rb: find parent query rewrite