title: Rails: Storing BigDecimal in Database
body: <p>I am handling a bunch of BigDecimals, which I want to store to my database. Ideally without any loss of accuracy. I don't know the nicest way to achieve that.</p>
  
  <hr>
  
  <p><em>This came to my mind:</em></p>
  
  <pre><code>t.decimal :value, precision: 1000, scale: 30
  </code></pre>
  
  <p>It does not look like a good way to approach this problem. 1. it still compromises accuracy. 2. It's is getting unnecessarily large.</p>
  
  <hr>
  
  <p>Is there a way to store the object, e.g.: <code>#&lt;BigDecimal:586a238,'0.563E0',9(36)&gt;</code> to the database (within a <code>text</code> column) and then re-initialize it as a BigDecimal?</p>