summaryrefslogtreecommitdiffstats
path: root/lib/tasks/migrate_from_trac.rake
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-29 20:08:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-29 20:08:14 +0000
commit2cf11bd64e7b272171f72cac1572e26224daf4ca (patch)
tree00a7aa2a9c18f16e4a2f099173e189d349097330 /lib/tasks/migrate_from_trac.rake
parentbf6e02c7394a468ac4a385c179e2eb7c3769eb52 (diff)
downloadredmine-2cf11bd64e7b272171f72cac1572e26224daf4ca.tar.gz
redmine-2cf11bd64e7b272171f72cac1572e26224daf4ca.zip
Fixed Mantis importer: projects trackers and modules assignment
Fixed Trac and Mantis importers: roles assignments git-svn-id: http://redmine.rubyforge.org/svn/trunk@936 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/tasks/migrate_from_trac.rake')
-rw-r--r--lib/tasks/migrate_from_trac.rake11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake
index 6467a5430..429b39623 100644
--- a/lib/tasks/migrate_from_trac.rake
+++ b/lib/tasks/migrate_from_trac.rake
@@ -54,10 +54,11 @@ namespace :redmine do
'task' => TRACKER_FEATURE,
'patch' =>TRACKER_FEATURE
}
-
- DEFAULT_ROLE = Role.find_by_position(3)
- manager_role = Role.find_by_position(1)
- developer_role = Role.find_by_position(2)
+
+ roles = Role.find(:all, :conditions => {:builtin => 0}, :order => 'position ASC')
+ manager_role = roles[0]
+ developer_role = roles[1]
+ DEFAULT_ROLE = roles.last
ROLE_MAPPING = {'admin' => manager_role,
'developer' => developer_role
}
@@ -173,7 +174,7 @@ namespace :redmine do
elsif TracPermission.find_by_username_and_action(username, 'developer')
role = ROLE_MAPPING['developer']
end
- Member.create(:user => u, :project => @target_project, :role => DEFAULT_ROLE)
+ Member.create(:user => u, :project => @target_project, :role => role)
u.reload
end
u