thoughtbot/factory_girl — pull request #356 by joshuaclayton (2012-04-20 16:03:40+00:00)
Title: Allow FactoryGirl::Syntax::Methods be called inside dynamic attributes

This allows us to use

FactoryGirl.define do
sequence(:random_string) { LoremIpsum.generate }

factory :post do
title { generate(:random_string) } # instead of FactoryGirl.generate(:random_string)
end

factory :comment do
post
body { generate(:random_string) } # instead of FactoryGirl.generate(:random_string)
end
end