title: FactoryGirl - NoMethodError when calling def_delegators
body: <p>I'm using FactoryGirl and Rspec for testing on rails, and I have come across a problem when I use methods that are define using <code>def_delegators</code>.</p>
  
  <p>For example this test:</p>
  
  <pre><code>it 'has the weekly discount' do
    //I also tried using create here
    menu = FactoryGirl.build(:menu, weekly_price: 100, price: 200)
    meal = FactoryGirl.build(:meal, menu: menu)
    price = meal.price
  end
  </code></pre>
  
  <p>Fails on the last line with this error:</p>
  
  <pre><code>1) Order has the weekly discount
     Failure/Error: price = meal.price
  
     NoMethodError:
       undefined method `price' for nil:NilClass
     # ./spec/models/order_spec.rb:17:in `block (2 levels) in &lt;top (required)&gt;'
  </code></pre>
  
  <p>And this is how price is defined in <code>Meal</code>:</p>
  
  <pre><code>class Meal &lt; ApplicationRecord
    extend Forwardable
    belongs_to :menu
  
    def_delegators :@menu, :price
  end
  </code></pre>
  
  <p>If I change it to this:</p>
  
  <pre><code>class Meal &lt; ApplicationRecord
    extend Forwardable
    belongs_to :menu
  
    def price
      menu.price
    end
  end
  </code></pre>
  
  <p>The test passes. I use def_delegators in other places and in all the tests have been failing with the same <code>NoMethodError</code>.</p>