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:
parent
3281bf5706
commit
4b7920decc
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue