title: How can I store a hash in my database?
body: <p>Is there a Ruby, or Activerecord method that can write and read a hash to and from a database field?</p>
  
  <p>I need to write a web utility to accept POST data and save it to a database, then later on pull it from the database in its original hash form. But ideally without 'knowing' what the structure is. In other words, my data store needs to be independent of any particular set of hash keys.</p>
  
  <p>For example, one time the external app might POST to my app:</p>
  
  <pre><code>"user" =&gt; "Bill",
  "city" =&gt; "New York"
  </code></pre>
  
  <p>But another time the external app might POST to my app:</p>
  
  <pre><code>"company" =&gt; "Foo Inc",
  "telephone" =&gt; "555-5555"
  </code></pre>
  
  <p>So my utility needs to save an arbitrary hash to a <code>text</code> field in the database, then, later, recreate the hash from what was saved.</p>