]> source.dussan.org Git - redmine.git/commitdiff
Updates mantis importer for new project name/identifier max lengths (#6446).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 14 Nov 2010 13:16:39 +0000 (13:16 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 14 Nov 2010 13:16:39 +0000 (13:16 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4403 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/tasks/migrate_from_mantis.rake

index 594a7ec0e0e86f856af11663a9b903e45d950522..e9244fcaf7f9340edfe0a4b4d42aa6d60dd182f6 100644 (file)
@@ -120,12 +120,8 @@ task :migrate_from_mantis => :environment do
       has_many :news, :class_name => "MantisNews", :foreign_key => :project_id\r
       has_many :members, :class_name => "MantisProjectUser", :foreign_key => :project_id\r
       \r
-      def name\r
-        read_attribute(:name)[0..29]\r
-      end\r
-      \r
       def identifier\r
-        read_attribute(:name).underscore[0..19].gsub(/[^a-z0-9\-]/, '-')\r
+        read_attribute(:name).gsub(/[^a-z0-9\-]+/, '-').slice(0, Project::IDENTIFIER_MAX_LENGTH)\r
       end\r
     end\r
     \r