When the username is optional, the validateIsUnique method wouldn't pass because the $identity array was never empty. This ensures it's cleared of all empty values before validating, and then checks empty array.
Coverage increased (+0.0%) when pulling 10b5be3870edf63a52e801b0d1131ff480edb12e on hotmeteor:patch-1 into ee6a678b05ae732c78ce1b88e64ba9e676696cf8 on Zizaco:username-optional.
When the username is optional, the
validateIsUnique
method wouldn't pass because the$identity
array was never empty. This ensures it's cleared of all empty values before validating, and then checks empty array.