Dont use range and regexp to_json if > rails 4.1