diff --git a/app/models/request.rb b/app/models/request.rb index ae5727576..95623d9a8 100644 --- a/app/models/request.rb +++ b/app/models/request.rb @@ -1,4 +1,5 @@ class Request + require 'lib/common' include MongoMapper::Document include Diaspora::Webhooks include ROXML diff --git a/app/models/user.rb b/app/models/user.rb index 812d1f9e5..37f8122d0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -43,6 +43,7 @@ class User < Person request = Request.where(:id => friend_request_id).first request.activate_friend request.person = self + request.destination_url = request.callback_url request.push_to_url(request.callback_url) request.destroy end diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb new file mode 100644 index 000000000..89b1a4376 --- /dev/null +++ b/db/seeds/dev.rb @@ -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])) +} + +