title: no implicit conversion from nil to integer - when trying to add anything to array
body: <p>I'm trying to build a fairly complex hash and I am strangely getting the error</p>
  
  <pre><code>no implicit conversion from nil to integer
  </code></pre>
  
  <p>when I use the line</p>
  
  <pre><code>manufacturer_cols &lt;&lt; {:field =&gt; 'test'}
  </code></pre>
  
  <p>I use the same line later in the same loop, and it works no problem.</p>
  
  <p>The entire code is</p>
  
  <pre><code>manufacturer_cols=[]
  manufacturer_fields.each_with_index do |mapped_field, index|
  
  
          if mapped_field.base_field_name=='exactSKU'
  
              #this is where it is breaking, if I comment this out, all is good
              manufacturer_cols &lt;&lt; { :base_field=&gt; 'test'}
  
  
      else
  
  
          #it works fine here!
          manufacturer_cols &lt;&lt; { :base_field=&gt;mapped_field.base_field_name }
      end
  end
  </code></pre>
  
  <p>------- value of manufacturer_fields --------</p>
  
  <p>[{"base_field":{"base_field_name":"Category","id":1,"name":"Category"}},{"base_field":{"base_field_name":"Description","id":3,"name":"Short_Description"}},{"base_field":{"base_field_name":"exactSKU","id":5,"name":"Item_SKU"}},{"base_field":{"base_field_name":"Markup","id":25,"name":"Retail_Price"}},{"base_field":{"base_field_name":"Family","id":26,"name":"Theme"}}]</p>