Work around JSON encoding issue in rails 3.2.13