Mercurial > hg > soundsoftware-site
comparison lib/tasks/.svn/text-base/migrate_from_mantis.rake.svn-base @ 119:8661b858af72
* Update to Redmine trunk rev 4705
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 14:12:06 +0000 |
parents | 94944d00e43c |
children | 0579821a129a |
comparison
equal
deleted
inserted
replaced
39:150ceac17a8d | 119:8661b858af72 |
---|---|
86 class MantisUser < ActiveRecord::Base | 86 class MantisUser < ActiveRecord::Base |
87 set_table_name :mantis_user_table | 87 set_table_name :mantis_user_table |
88 | 88 |
89 def firstname | 89 def firstname |
90 @firstname = realname.blank? ? username : realname.split.first[0..29] | 90 @firstname = realname.blank? ? username : realname.split.first[0..29] |
91 @firstname.gsub!(/[^\w\s\'\-]/i, '') | |
92 @firstname | 91 @firstname |
93 end | 92 end |
94 | 93 |
95 def lastname | 94 def lastname |
96 @lastname = realname.blank? ? '-' : realname.split[1..-1].join(' ')[0..29] | 95 @lastname = realname.blank? ? '-' : realname.split[1..-1].join(' ')[0..29] |
97 @lastname.gsub!(/[^\w\s\'\-]/i, '') | |
98 @lastname = '-' if @lastname.blank? | 96 @lastname = '-' if @lastname.blank? |
99 @lastname | 97 @lastname |
100 end | 98 end |
101 | 99 |
102 def email | 100 def email |
222 def format | 220 def format |
223 read_attribute :type | 221 read_attribute :type |
224 end | 222 end |
225 | 223 |
226 def name | 224 def name |
227 read_attribute(:name)[0..29].gsub(/[^\w\s\'\-]/, '-') | 225 read_attribute(:name)[0..29] |
228 end | 226 end |
229 end | 227 end |
230 | 228 |
231 class MantisCustomFieldProject < ActiveRecord::Base | 229 class MantisCustomFieldProject < ActiveRecord::Base |
232 set_table_name :mantis_custom_field_project_table | 230 set_table_name :mantis_custom_field_project_table |