Skip to content

Instantly share code, notes, and snippets.

@howethomas
Created March 30, 2010 16:35
Show Gist options
  • Save howethomas/349272 to your computer and use it in GitHub Desktop.
Save howethomas/349272 to your computer and use it in GitHub Desktop.
module FixtureReplacement
attributes_for :person do |u|
u.first_name = Random.firstname_male
u.last_name = Random.lastname
u.email_address = Random.number(10000).to_s+Random.email
u.im_handle = "#{u.first_name}#{Random.number(10000)}"
u.im_service = "gtalk"
u.phone_number_office = Random.international_phone
u.phone_number_mobile = Random.international_phone
u.phone_number_home = Random.international_phone
u.phone_number_fax = Random.international_phone
u.phone_number_office_ext = Random.number(10)
u.company_id = Company.find('random')
u.administrator = false
u.deleted = false
end
attributes_for :user do |u|
u.login = Random.firstname_male+Random.number(1000).to_s+Random.lastname
u.email = Random.number(10000).to_s+Random.email
end
attributes_for :company do |u|
u.name = Random.lastname+[" Industrial", " Communications", " Enterprises", " Productions", " Software", " Hardware", " Limited", " Incorporated"][rand(7)]
u.web_address = "http://www.#{Random.lastname}.com/"
u.phone_number_office = Random.international_phone
u.phone_number_fax = Random.international_phone
u.country = ["Turkey", "Macedonia", "Syria", "Georgia"][rand(3)]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment