Sha256: 20662355192c42e29087a40fd3e7738aa8d2c72298e2a524a27af33e54f070c1
Contents?: true
Size: 558 Bytes
Versions: 10
Compression:
Stored size: 558 Bytes
Contents
Factory.sequence(:zone_sequence) {|n| "Zone ##{n}"} Factory.define(:global_zone, :class => Zone) do |record| record.name "GlobalZone" record.description { Faker::Lorem.sentence } record.zone_members {|proxy| zone = proxy.instance_eval{@instance} Country.find(:all).map{|c| ZoneMember.create({:zoneable => c, :zone => zone})} } end Factory.define(:zone) do |f| f.name { Faker::Lorem.words.join(' ') } f.description { Faker::Lorem.sentence } f.zone_members do |member| [ZoneMember.create(:zoneable => Factory(:country) )] end end
Version data entries
10 entries across 10 versions & 1 rubygems