title: Rails select_all deserialize Postgresql array
body: <p>I make a custom query that returns rows with array value <strong>term_names</strong></p>
  <pre><code>Product.connection.select_all(&quot;
    SELECT ARRAY_AGG(terms.name), vocabularies.name vocabulary_name
    FROM terms
    INNER JOIN vocabularies ON vocabularies.id = terms.vocabulary_id
    GROUP BY vocabulary_name&quot;)
  
  | term_names                                                     | vocabulary_name |
  |----------------------------------------------------------------|-----------------|
  | {{76,Yellow},{77,Green},{79,Blue}.                             | Color           |
  </code></pre>
  <p>But the problem is that Rails does not want to convert {...} into ruby array and returns it as string.</p>
  <pre><code>[{&quot;array_agg&quot;=&gt;&quot;{Yellow,Green,Blue}&quot;, &quot;vocabulary_name&quot;=&gt;&quot;Color&quot;}]
  </code></pre>
  <p>How can I make Rails parse result and return nested array instead?</p>