From 1e491c0bfdcf24639c20a619c308436f47c652d1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 29 Apr 2012 09:49:02 +0000 Subject: [PATCH] Makes migrate_from_mantis compatible with Rails3. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9581 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/tasks/migrate_from_mantis.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake index e602455af..191e56b81 100644 --- a/lib/tasks/migrate_from_mantis.rake +++ b/lib/tasks/migrate_from_mantis.rake @@ -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', -- 2.39.5