OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/lib/tasks/sample_data.rake

23 lines
680 B

namespace :sample_data do
desc "Create the given number of fake projects"
task :projects, [:nr_of_projects] => :environment do |task, args|
puts "Creating #{args[:nr_of_projects]} fake projects"
args[:nr_of_projects].to_i.times do |i|
project = Project.create(name: Faker::Commerce.product_name,
identifier: "#{Faker::Code.isbn}-#{i}",
description: Faker::Lorem.paragraph(5),
types: Type.all,
is_public: true
)
puts "created: #{project.name}"
end
puts "#{args[:nr_of_projects]} fake projects created"
end
end