title: Rails: Adding migration to add an array (default empty)
body: <p>I'm trying to add a column called share to one of my resources.
  The idea is that users can upload documents and share them with other (specific) users, and the array contains the emails of those that the user wants to share with.</p>
  
  <p>I tried adding a migration with the code</p>
  
  <pre><code>class AddShareToDocuments &lt; ActiveRecord::Migration
    def change
      add_column :documents, :share, :array, :default =&gt; []
    end
  end
  </code></pre>
  
  <p>But when I open up rails console in the command prompt, it says that share:nil and user.document.share.class is NilClass.</p>
  
  <p>Creating a new array in the rails console sandbox by typing </p>
  
  <pre><code>newarray = []
  </code></pre>
  
  <p>says that newarray.class is Array.</p>
  
  <p>Can anyone spot what I'm doing wrong?</p>