Changing db seed to friending

This commit is contained in:
Raphael 2010-07-14 12:06:39 -07:00
parent d7d1af8058
commit a15ee6feab
2 changed files with 16 additions and 13 deletions

View file

@ -58,15 +58,16 @@ def create(backer_number, password)
:url=> "#{email}.joindiaspora.com") :url=> "#{email}.joindiaspora.com")
# Make connection with Diaspora Tom # Make connection with Diaspora Tom
Person.create( :email => "tom@joindiaspora.com", :url => "http://tom.joindiaspora.com/", :active => true, :profile => Profile.new(:first_name => "Alexander", :last_name => "Hamiltom")) User.owner.send_friend_request_to('http://tom.joindiaspora.com/')
#Person.create( :email => "tom@joindiaspora.com", :url => "http://tom.joindiaspora.com/", :active => true, :profile => Profile.new(:first_name => "Alexander", :last_name => "Hamiltom"))
# Make people # Make people
(0..10).each { |n| #(0..10).each { |n|
email = backer_info[n][2].gsub(/ /,'').downcase #email = backer_info[n][2].gsub(/ /,'').downcase
Person.create( :email => "#{email}@joindiaspora.com", #Person.create( :email => "#{email}@joindiaspora.com",
:url => "http://#{email}.joindiaspora.com/", #:url => "http://#{email}.joindiaspora.com/",
:active => true, #:active => true,
:profile => Profile.new(:first_name => backer_info[n][1], :last_name => backer_info[n][2])) unless n == backer_number #:profile => Profile.new(:first_name => backer_info[n][1], :last_name => backer_info[n][2])) unless n == backer_number
} #}
end end

View file

@ -1,4 +1,4 @@
# This file should contain all the record creation needed to seed the database with its default values. #This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
# #
# Examples: # Examples:
@ -50,9 +50,11 @@ names = [ ["George", "Washington"],
] ]
# Make people # Make people
(0..10).each { |n| #(0..10).each { |n|
email = names[n][1].gsub(/ /,'').downcase #email = names[n][1].gsub(/ /,'').downcase
Person.create( :email => "#{email}@joindiaspora.com", :url => "http://#{email}.joindiaspora.com/", :active => true, :profile => Profile.new(:first_name => names[n][0], :last_name => names[n][1])) #Person.create( :email => "#{email}@joindiaspora.com", :url => "http://#{email}.joindiaspora.com/", :active => true, :profile => Profile.new(:first_name => names[n][0], :last_name => names[n][1]))
#}
Request.all.each{|r|
User.owner.accept_friend_request(r.id)
} }