title: getting ID of activerecord model
body: <p>Current Code</p>
  
  <pre><code>@current_site_name = 'SITENAME'
  @current_site = Site.where(:name =&gt; @current_site_name)
  @current_site_id = @current_site.id
  </code></pre>
  
  <p>Basically, the <code>name</code> column in our <code>Site</code> model is unique. We are selecting a row using the site name as a parameter.</p>
  
  <p>I am returned: <code>&lt;ActiveRecord::Relation:0x59426bc1&gt;</code></p>
  
  <p>I understand that I cannot simply ask for <code>@current_site.id</code> but is there any way to put the ID of the single activerecord into the variable <code>@current_site_id</code></p>
  
  <p>Again, there will always be one active record.</p>