008-projects.rb revision 10761e1910f7d163502ff7d435a9cd361161f136
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes### Import Projects
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholescount = 10
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholescontact = ''
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes3.times { contact << "#{Faker::Name.name}, " }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholescontact.chop!.chop!
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholescount.times do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes p = Project.new \
0662ed52e814f8f08ef0e09956413a792584eddffuankg name: Faker::Company.catch_phrase,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes institution: Faker::Company.name,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes homepage: Faker::Internet.url,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes description: Faker::Lorem.sentence,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes contact: contact
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes p.save!
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesend
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholesOntology.all.each do |o|
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes o.projects Project.where(id: (rand(OntologyType.count)+1))
16b55a35cff91315d261d1baa776138af465c4e4fuankg o.save!
16b55a35cff91315d261d1baa776138af465c4e4fuankgend
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes