title: Return Single Field with Rails Query
body: <p>I'm having trouble with something that should be so easy, but I don't know what I'm doing wrong.  I'm simply trying to do a query that returns a single field instead of the complete record in Rails 3.</p>
  
  <p>model method</p>
  
  <pre><code>def self.find_user_username(user_id)
    user_name = User.select("user_name").where(user_id)
    return user_name
  end
  </code></pre>
  
  <p>I'm staring at the Rails Guide ( <a href="http://guides.rubyonrails.org/active_record_querying.html#selecting-specific-fields" rel="noreferrer">http://guides.rubyonrails.org/active_record_querying.html#selecting-specific-fields</a>)
  and it simply says (where viewable_by, locked = fields):</p>
  
  <pre><code>Client.select("viewable_by, locked")
  </code></pre>
  
  <p>I've tried flip flopping the select, like so:</p>
  
  <pre><code>User.select("user_name").where(user_id) - AND - 
  User.where(user_id).select("user_name")
  </code></pre>
  
  <p>but neither work.  In fact, I even tried: </p>
  
  <pre><code>user_name = User.select("yoda").where(user_id)
  </code></pre>
  
  <p>and I didn't get an error.  When I look in the view, where I have:</p>
  
  <pre><code>Friend.find_user_username(friend.user_id)
  </code></pre>
  
  <p>I just keep getting the hash: ActiveRecord::Relation:0x2f4942f0</p>