title: How to build factory girl association?
body: <p>I'm having troubles building association. I have my models defined like this:</p>
  
  <pre><code>class Conversation
    belongs_to :user1
    belongs_to :user2
    has_many :messages
  end
  </code></pre>
  
  <p>and I've defined these factories</p>
  
  <pre><code>factory :user do
    name "name"
  end
  
  factory :female, parent: :user do
    gender 'f'
  end 
  
  factory :male, parent: :user do
    gender 'm'
  end 
  
  factory :message do
    message "message"
    conversation
  end
  </code></pre>
  
  <p>Now I'm trying to create factory "conversation_with_messages" like this</p>
  
  <pre><code>factory :conversation do
      read false
      association :user1, factory: :male
      association :user2, factory: :female    
      factory :conversation_with_messages do
  
        ignore do
          messages_count 10
        end
  
        after(:create) do |conversation, evaluator|
          FactoryGirl.create_list(:message, evaluator.messages_count, author: conversation.user1)
        end
      end
    end
  </code></pre>
  
  <p>but doing <code>FactoryGirl.create(:conversation_with_messages)</code> gives database error saying that user1_id column needs to be not null.</p>
  
  <p>I'm wondering why this column isn't filled and what I'm doing wrong here?</p>