title: How can I persist an array to the database in Ruby on Rails?
body: <p>I'm trying to persist an Array of Arrays to my SQLite database in Rails.</p>
  
  <p>Right now, I've got an object that can hold such an Array, and instances appear to save with no problem. However, it's clearly not being persisted to the database-- when I call functions on My_Object.array in views different than the one that the array is created on, it comes out nil and doesn't work.</p>
  
  <p>For example:</p>
  
  <pre><code>class My_Object &lt; ActiveRecord::Base
    attr_accessor :array
  end
  </code></pre>
  
  <p>When I call <code>My_Object.new(:array =&gt; [ [1, 2, 3], [4, 5, 6] ])</code>, everything appears to work properly, but I can't access the <code>:array</code> property anywhere else, it just turns out nil.</p>
  
  <p>Any ideas?</p>