The court ruled 5 to 2 that Michigan 's 2004 ban against same-sex marriage also blocks domestic-partner policies affecting gay employees at the University of Michigan and other public-sector employers .