Using .select or .map to get an array of names from an activerecord model
<p>I am trying to get an array of names from an activerecord model based on a search query.</p>

<p>I have this method in my item model.  </p>

<pre><code>def self.search(search)
    if search
      where(['lower(name) LIKE ?', "%#{search}%"])
    else
      Item.all
    end
  end
</code></pre>

<p>I am trying to figure out the difference between using these two lines they are both returning the same thing.</p>

<p><code>Item.search('ex').select('name').map(&amp;:name)</code> vs
<code>Item.search('ex').map(&amp;:name)</code></p>