Sha256: a821254f67b0d5bb0f2d1452753897addd4f90737dbc1df133c1ab347c4b769f
Contents?: true
Size: 548 Bytes
Versions: 19
Compression:
Stored size: 548 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 } f.description { Faker::Lorem.sentence } f.zone_members do |member| [ZoneMember.create(:zoneable => Factory(:country) )] end end
Version data entries
19 entries across 19 versions & 6 rubygems