Properly track falsy instances in RelationCounterField.
Review Request #9749 — Created March 6, 2018 and submitted
RelationCounterField(and parts of
CounterField) were testing
instances for truthiness to see if they were valid (i.e., references
haven't dropped), but if an instance defined
(with a result of 0), the checks would fail and state would be lost.
These checks have changed to explicitly check against
that we don't accidentally lose anything in these cases, and to add
validity checks in places where they were missing.
While here, I also got rid of a method that was defined that was never
used. It was also assuming validity, and rather than fix it, it was
worth just getting rid of the function.
Unit tests pass. They failed with the addition of a
function in the models prior to these fixes.