diff lib/tasks/migrate_from_mantis.rake @ 51:371eac10df0b live

* Merge from "cannam" branch. This includes update to Redmine trunk, plus welcome/tip-of-the-day from luisf branch.
author Chris Cannam
date Wed, 24 Nov 2010 12:20:08 +0000
parents 94944d00e43c
children 8661b858af72
line wrap: on
line diff
--- a/lib/tasks/migrate_from_mantis.rake	Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/migrate_from_mantis.rake	Wed Nov 24 12:20:08 2010 +0000
@@ -120,12 +120,8 @@
       has_many :news, :class_name => "MantisNews", :foreign_key => :project_id
       has_many :members, :class_name => "MantisProjectUser", :foreign_key => :project_id
       
-      def name
-        read_attribute(:name)[0..29]
-      end
-      
       def identifier
-        read_attribute(:name).underscore[0..19].gsub(/[^a-z0-9\-]/, '-')
+        read_attribute(:name).gsub(/[^a-z0-9\-]+/, '-').slice(0, Project::IDENTIFIER_MAX_LENGTH)
       end
     end