Ruling restores election day registration