Preventing stack too deep errors on rails 3.2.x