title: Pass parameter in setting attribute on association in FactoryGirl
body: <p>I want to pass a parameter into a factory that will be used to set the attribute on an associated model. The associated model is created within the factory.</p>
  
  <p>I have a Transaction model with a many-to-many link to itself through a join table TxLink.
  I want to call <code>link = FactoryGirl.create(:link_red_to_sub, sub: 10, red: 7)</code> which will create two Transaction objects and a TxLink that links the two.</p>
  
  <p>I get an error in the association line below because of the <code>units: sub</code> at the end. The error is "trait not defined". I tried <code>units: { sub }</code> (with brackets) instead but no dice.</p>
  
  <pre><code>factory :tx_link do
      units "9.99"
  
      factory :link_red_to_sub do
        ignore do
          sub 0
          red 0
        end
        units { red }
  
        association :giver, factory: :transaction, units: sub
        association :taker, factory: :redemption, units: red
      end
    end
  </code></pre>