Join GitHub today
Select nodes without childrens #120
That is difficult, since it is not a local property of a node whether it's a leaf or not. You could use a subquery in the where clause that excludes results for which there are records that match the child ancestry of the result, but that could get ugly. Alternatively you could cache the 'leaf-status' on the node. This could be a boolean, default true, that becomes false if you add a new node under a node.
I think I should try the 2nd approach but I'm not sure how to do it (I'm a newbie in rails)
I'm trying something like this in my renewal.rb
but it explodes when it should update the counter with a this error
Do you mean something like this?