diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-11-14 13:16:39 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-11-14 13:16:39 +0000 |
commit | 97a9210483c121639ca576e91f9f6b767400fbf8 (patch) | |
tree | 44d920e74d55d3432c5a57dc76463a1c56e4baf1 | |
parent | 8ef06826c31b3042f6720c249199504a49e08c01 (diff) | |
download | redmine-97a9210483c121639ca576e91f9f6b767400fbf8.tar.gz redmine-97a9210483c121639ca576e91f9f6b767400fbf8.zip |
Updates mantis importer for new project name/identifier max lengths (#6446).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4403 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | lib/tasks/migrate_from_mantis.rake | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake index 594a7ec0e..e9244fcaf 100644 --- a/lib/tasks/migrate_from_mantis.rake +++ b/lib/tasks/migrate_from_mantis.rake @@ -120,12 +120,8 @@ task :migrate_from_mantis => :environment do 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
|