Task to assign user developer role to all projects

This commit is contained in:
Seif Attar 2012-08-23 10:48:55 +01:00
parent 22ec463764
commit 2d6a3e6b67

View file

@ -14,3 +14,13 @@ task :add_users_to_project_teams => :environment do |t, args|
UsersProject.bulk_import(project, admins, UsersProject::MASTER)
end
end
desc "Add user to as a developer to all projects"
task :add_user_to_project_teams, [:email] => :environment do |t, args|
user_email = args.email
user = User.find_by_email(user_email)
project_ids = Project.all.map(&:id)
UsersProject.user_bulk_import(user,project_ids,UsersProject::DEVELOPER)
end