Fix deprecation. Extend project unixname validation regexp. Add rollback callbacks to avoid core polution. Increase git timeout. Improve import script. Refs #2162

This commit is contained in:
Pavel Chipiga 2011-10-30 14:54:10 +02:00
parent 3281bf5706
commit 4b7920decc
1 changed files with 4 additions and 2 deletions

View File

@ -6,8 +6,10 @@ namespace :import do
print "Import #{name}..."
owner = User.find(2) # vsharshov@gmail.com
# owner = Group.find(1) # Core Team
puts Project.create(:name => name, :unixname => name) {|p| p.owner = owner} ? "Ok!" : "Fail!"
sleep 1
# puts Project.create(:name => name, :unixname => name) {|p| p.owner = owner} ? "Ok!" : "Fail"
p = Project.find_or_create_by_name_and_unixname(name, name) {|p| p.owner = owner}
puts p.persisted? ? "Ok!" : "Fail!"
# sleep 1
end
puts 'DONE'
end