The ruling impacts the Democratic primary in Atlantic County, where a narrow margin separates the leading candidates.