title: Convert symbols to string when serializing with Oj.dump
body: <p><strong>Problem Summary:</strong> I am attempting to serialize a hash to JSON using the <a href="https://github.com/ohler55/oj" rel="nofollow noreferrer">Oj gem</a>. It seems that Oj does not automatically convert the symbol keys of the hash to strings. I am wondering if Oj has an option to "stringify" during serialization?</p>
  
  <p>This is an example of my hash:</p>
  
  <pre><code>example_hash = 
   {:id=&gt;1234,
    :asset_number=&gt;"1234-5678",
    :latitude=&gt;34.78495,
    :longitude=&gt;-92.12899,
    :last_tracking_record_id=&gt;123456789,
    :bearing=&gt;42,
    :threat_level=&gt;:severe}
  </code></pre>
  
  <p>And the above is rendered like so:</p>
  
  <pre><code>render json: Oj.dump(example_hash)
  </code></pre>
  
  <p>The resulting JSON unfortunately has keys that look exactly like the above, meaning I would need to access elements in JavaScript like so: <code>response[:asset_number]</code>. Since the client-side code was implemented months ago, and have only now added Oj, I would prefer to find a way to stringify the keys during serialization server-side.</p>
  
  <p>Oj has an option called <code>symbol_keys</code>, which is a boolean, however setting it to either <code>true</code> or <code>false</code> seems to have no effect in this regard.</p>
  
  <p>The only solution I have found thus far is to use <code>with_indifferent_access</code> as suggested in <a href="https://stackoverflow.com/a/10549699/877472">this answer</a>, however in some cases I have arrays of hashes; while I can technically invoke that method for each hash in that array, given that Oj is meant to speed up Json serialization I would prefer to find a way to do this with Oj itself. Ultimately, I wonder if there is an option or setting in Oj that will perform this <em>during</em> serialization.</p>