fix json serializing in rails 4