Makes migrate_from_mantis compatible with Rails3.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9581 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-04-29 09:49:02 +00:00
parent fb8ca0d2f8
commit 1e491c0bfd
1 changed files with 4 additions and 4 deletions

View File

@ -271,8 +271,8 @@ task :migrate_from_mantis => :environment do
next unless p.save
projects_map[project.id] = p.id
p.enabled_module_names = ['issue_tracking', 'news', 'wiki']
p.trackers << TRACKER_BUG
p.trackers << TRACKER_FEATURE
p.trackers << TRACKER_BUG unless p.trackers.include?(TRACKER_BUG)
p.trackers << TRACKER_FEATURE unless p.trackers.include?(TRACKER_FEATURE)
print '.'
# Project members
@ -331,7 +331,7 @@ task :migrate_from_mantis => :environment do
# Redmine checks that the assignee is a project member
if (bug.handler_id && users_map[bug.handler_id])
i.assigned_to = User.find_by_id(users_map[bug.handler_id])
i.save_with_validation(false)
i.save(:validate => false)
end
# Bug notes
@ -476,7 +476,7 @@ task :migrate_from_mantis => :environment do
break unless STDIN.gets.match(/^y$/i)
# Default Mantis database settings
db_params = {:adapter => 'mysql',
db_params = {:adapter => 'mysql2',
:database => 'bugtracker',
:host => 'localhost',
:username => 'root',