title: How to reload a variable defined by let
body: <p>A <code>user</code> has many <code>comments</code>, so I would like to have a factory <code>user</code> with a <code>comment</code> associated to it (<code>user_with_comment</code>):</p>
  
  <pre><code>factory :user, class: User  do |t|
    ...
    factory :user_with_comment do |t|
      after(:create) do |user|
        FactoryGirl.create(:comment, user_id: user.id)
      end
  end
  </code></pre>
  
  <p>It works fine... when I call <code>FactoryGirl.create(:user_with_comment)</code>, it creates the <code>user</code> and the related <code>comment</code> in my <code>test db</code>.</p>
  
  <p>However, I'm facing some issues in the <code>controller_spec</code>:</p>
  
  <p>Using <code>let</code> I have to reload the <code>user</code> to see the <code>comment</code>:</p>
  
  <pre><code>let(:user) { FactoryGirl.create(:user_with_comment) }
  user.comments.size #=&gt;0
  user.reload
  user.comments.size #=&gt;1
  </code></pre>
  
  <p>One solution would be using <code>before(:each)</code>, but it will create <code>venda</code> and <code>comment</code> before each test:</p>
  
  <pre><code>before(:each) do
    @user = FactoryGirl.create(:user_with_comment)
  end
  @user.comments.size #=&gt;1
  </code></pre>
  
  <p>Or, I can reload the <code>user</code>before each test, but it will also hit the database:</p>
  
  <pre><code>let(:user) { FactoryGirl.create(:user_with_comment) }
  before(:each) do
    user.reload
  end
  </code></pre>
  
  <p>What is the best approach in this situation? </p>