The following worked for me:
Factory.define :event do |f|
f.association :organization
f.name { "Event: #{Faker::Lorem.words(3).join(" ").titleize}" }
end
Factory.define :venue do |f|
f.association :organization
f.name { "Venue: #{Faker::Lorem.words(2).join(" ").titleize}" }
end
Factory.define :occurence do |f|
f.event { |o| o.association(:event) }
f.venue { |o| o.association(:venue, :organization =>
o.event.organization) }
...
end
Your tip helped - thanks Nathan.
On Nov 27, 4:02 am, Nathan Sutton <nathan.sut...@gmail.com> wrote: