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
This commit is contained in:
parent
8ef06826c3
commit
97a9210483
|
@ -120,12 +120,8 @@ task :migrate_from_mantis => :environment do
|
||||||
has_many :news, :class_name => "MantisNews", :foreign_key => :project_id
|
has_many :news, :class_name => "MantisNews", :foreign_key => :project_id
|
||||||
has_many :members, :class_name => "MantisProjectUser", :foreign_key => :project_id
|
has_many :members, :class_name => "MantisProjectUser", :foreign_key => :project_id
|
||||||
|
|
||||||
def name
|
|
||||||
read_attribute(:name)[0..29]
|
|
||||||
end
|
|
||||||
|
|
||||||
def identifier
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue