Ruby: How to write an array to postgresql?
<p>This is the migration file:</p>

<pre><code>class AddDependentColumnToFeatures &lt; ActiveRecord::Migration
  def change
    add_column :features, :dependent, :string, array: true, default: []
  end
end
</code></pre>

<p>this is a part of the array - the important field is "dependent":</p>

<pre><code>... display_on_detail_view"=&gt;"1", "description"=&gt;"", "dependent"=&gt;["569", "571"] ...
</code></pre>

<p>it is written on a form submit per "update_attributes" (Rails 3.2.13)</p>

<p>My problem now is, that in the database the migrate file created a "string" column with a default length of 255 characters. </p>

<p>the above array then looks like this, after it is put into the pg-database:</p>

<pre><code>---
- !binary |-
  NTY5
- !binary |-
  NTcx
</code></pre>

<p>which is not very helpful as this is just a test and the array will get way larger in production mode like 800 numbers instead of 2 - so the column length of 255 characters won't last long - is there a different way to store that array into the database? or am i already doing something wrong?</p>