DG MS debugging friend requests
This commit is contained in:
parent
874ea58678
commit
c7e1bc3a46
3 changed files with 60 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
class Request
|
class Request
|
||||||
|
require 'lib/common'
|
||||||
include MongoMapper::Document
|
include MongoMapper::Document
|
||||||
include Diaspora::Webhooks
|
include Diaspora::Webhooks
|
||||||
include ROXML
|
include ROXML
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ class User < Person
|
||||||
request = Request.where(:id => friend_request_id).first
|
request = Request.where(:id => friend_request_id).first
|
||||||
request.activate_friend
|
request.activate_friend
|
||||||
request.person = self
|
request.person = self
|
||||||
|
request.destination_url = request.callback_url
|
||||||
request.push_to_url(request.callback_url)
|
request.push_to_url(request.callback_url)
|
||||||
request.destroy
|
request.destroy
|
||||||
end
|
end
|
||||||
|
|
|
||||||
58
db/seeds/dev.rb
Normal file
58
db/seeds/dev.rb
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
# 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).
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
#
|
||||||
|
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
||||||
|
# Mayor.create(:name => 'Daley', :city => citie
|
||||||
|
|
||||||
|
require 'config/environment'
|
||||||
|
|
||||||
|
# Create seed user
|
||||||
|
user = User.create( :email => "robert@joindiaspora.com", :password => "monkey", :profile => Profile.create( :first_name => "bobert", :last_name => "brin" ))
|
||||||
|
|
||||||
|
names = [ ["George", "Washington"],
|
||||||
|
["John", "Adams"],
|
||||||
|
["Thomas", "Jefferson"],
|
||||||
|
["James", "Madison"],
|
||||||
|
["James", "Monroe"],
|
||||||
|
["John", "Quincy Adams"],
|
||||||
|
["Andrew", "Jackson"],
|
||||||
|
["Martin Van", "Buren"],
|
||||||
|
["William Henry","Harrison"],
|
||||||
|
["John", "Tyler"],
|
||||||
|
["James K." , "Polk"],
|
||||||
|
["Zachary", "Taylor"],
|
||||||
|
["Millard", "Fillmore"],
|
||||||
|
["Franklin", "Pierce"],
|
||||||
|
["James", "Buchanan"],
|
||||||
|
["Abraham", "Lincoln"],
|
||||||
|
["Andrew", "Johnson"],
|
||||||
|
["Ulysses S.", "Grant"],
|
||||||
|
["Rutherford B.", "Hayes"],
|
||||||
|
["James A.", "Garfield"],
|
||||||
|
["Chester A.", "Arthur"],
|
||||||
|
["Grover", "Cleveland"],
|
||||||
|
["Benjamin", "Harrison"],
|
||||||
|
["William", "McKinley"],
|
||||||
|
["Theodore", "Roosevelt"],
|
||||||
|
["William Howard", "Taft"],
|
||||||
|
["Woodrow", "Wilson"],
|
||||||
|
["Warren G.", "Harding"],
|
||||||
|
["Calvin", "Coolidge"],
|
||||||
|
["Herbert", "Hoover"],
|
||||||
|
["Franklin D.", "Roosevelt"],
|
||||||
|
["Harry S.", "Truman"],
|
||||||
|
["Dwight D.", "Eisenhower"],
|
||||||
|
["John F.", "Kennedy"],
|
||||||
|
["Lyndon B.", "Johnson"],
|
||||||
|
["Richard", "Nixon"]
|
||||||
|
]
|
||||||
|
|
||||||
|
# Make people
|
||||||
|
(0..10).each { |n|
|
||||||
|
email = names[n][1].gsub(/ /,'').downcase
|
||||||
|
Person.create( :email => "#{email}@joindiaspora.com", :url => "http://#{email}.joindiaspora.com/", :profile => Profile.create(:first_name => names[n][0], :last_name => names[n][1]))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in a new issue