title: Activerecord Array of Objects to comma separated string
body: <p>Say I have a model called "Fruit" and a query is returning all the distinct fruit names to @fruit: </p>
  
  <blockquote>
    <ul>
    <li><p>!ruby/object:Fruit attributes: 
    fruit_name: orange attributes_cache: {}</p></li>
    <li><p>!ruby/object:Fruit attributes: 
    fruit_name: apple attributes_cache: {}</p></li>
    <li><p>!ruby/object:Fruit attributes: 
    fruit_name: peach attributes_cache: {}</p></li>
    </ul>
  </blockquote>
  
  <p>I understand (somewhat) @fruit is an Array made up of Arrays (activerecord objects).  I'm trying to get the returned fruit names into a comma separated string, like: "orange,apple,peach".   </p>
  
  <p>If the array was made up of strings or numbers (instead of arrays), I know I could use map w/ .join(',') to do this.   I'm having trouble with the extra syntax needed to refer to the arrays in the array (the 'fruit_name' fields of the arrays at each array index).</p>
  
  <p>I know this would work, just not sure how to do this as a dynamic iteration: </p>
  
  <p>@fruit_string = @fruit[0].fruit_name + ',' + @fruit[1].fruit_name + ',' + @fruit[2].fruit_name</p>