Open cars10 opened 6 years ago
@cars10 Hey, your explanation sounds clear and I feel that your change has to improve this part of the code. But I'm afraid to break something if I merge this PR. Usually I use manual testing to be sure that everything is ok. Right now I don't have enough time to check it carefully.
I'm sorry for the delay. I like what you have done and I'll try to find time to check and merge it. Sorry, currently I don't work with ruby/rails too much to do it quickly.
In :199 we select the roots by loading all values of
opts[:boost][c.to_s]
wherec.to_s
is an existing parent. If it does not exist as parent we getnil
and throw that out with.compact
in the end.But we can use
&
beforehand to only loop through the ids that are present as parent, thus having fewer loops and removing the need to run.compact
.