title: How to extract value from hash in Rails
body: <p>I have a Hash and need to use the value year from a variable in it
  The example is:</p>
  
  <pre><code>2.2.4 :001 &gt; @values_project
  =&gt; [#&lt;CustomValue id: 20367, customized_type: "Project", customized_id: 492, custom_field_id: 64, year: "2017"&gt;] 
  </code></pre>
  
  <p>and I need the year
  so when I try <code>@value_hash.year</code> receive the error</p>
  
  <pre><code>NoMethodError: undefined method `year' for
  #&lt;ActiveRecord::Relation:0x0000000712fb18&gt;
  </code></pre>
  
  <p>I don't understand why</p>