title: Rails: How to handle "Attribute was supposed to be a Array, but was a String" error?
body: <p>I have a table with one column that is of text type. 
  There's a small string in it that should be serialized as an array</p>
  
  <pre><code>serialize :image_urls, Array 
  </code></pre>
  
  <p>There are times when SQL is just faster for inserting data. 
  When this is the case, I do the insert as a string </p>
  
  <pre><code>["image1.jpg", "image2.jpg"]
  </code></pre>
  
  <p>Since I'm inserting a string my Rails app crashes when it tries to read the data, with the following error message:</p>
  
  <pre><code>Attribute was supposed to be a Array, but was a String
  </code></pre>
  
  <p><strong>Is there a way to not have this error thrown, or to catch it and convert the data?</strong></p>
  
  <p>I mean converting the string to an array is just a simple call, so, this should be easy.  I just don't know where, or how to accomplish it.
  <hr>
  I sort of think overriding object_from_yaml, but I'm not sure where to do this work. 
  <br>Am I in the right track?  </p>