From 8a91468a62d556755f033b9247c8903c51c888f2 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 1 Jul 2010 18:07:35 -0700 Subject: [PATCH] Made deploy more readable --- db/seeds/backer.rb | 82 +++++++++++++++++++++++----------------------- db/seeds/tom.rb | 2 +- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index f6bbb7cf9..83520c9b6 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -11,42 +11,42 @@ require 'config/environment' def create(backer_number, password) - 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"] + backer_info = [ [5072,"George", "Washington"], + [3742,"John", "Adams"], + [7782,"Thomas", "Jefferson"], + [2691,"James", "Madison"], + [6133,"James", "Monroe"], + [7558,"John", "Quincy Adams"], + [8670,"Andrew", "Jackson"], + [1559,"Martin Van", "Buren"], + [5404,"William Henry","Harrison"], + [6431,"John", "Tyler"], + [1957,"James K." , "Polk"], + [5323,"Zachary", "Taylor"], + [8784,"Millard", "Fillmore"], + [4267,"Franklin", "Pierce"], + [8891,"James", "Buchanan"], + [2324,"Abraham", "Lincoln"], + [6948,"Andrew", "Johnson"], + [8176,"Ulysses S.", "Grant"], + [6928,"Rutherford B.", "Hayes"], + [5677,"James A.", "Garfield"], + [7966,"Chester A.", "Arthur"], + [2893,"Grover", "Cleveland"], + [6828,"Benjamin", "Harrison"], + [2982,"William", "McKinley"], + [6756,"Theodore", "Roosevelt"], + [6658,"William Howard", "Taft"], + [3551,"Woodrow", "Wilson"], + [3088,"Warren G.", "Harding"], + [8379,"Calvin", "Coolidge"], + [7493,"Herbert", "Hoover"], + [2759,"Franklin D.", "Roosevelt"], + [1029,"Harry S.", "Truman"], + [4013,"Dwight D.", "Eisenhower"], + [8507,"John F.", "Kennedy"], + [1508,"Lyndon B.", "Johnson"], + [5258,"Richard", "Nixon"] ] pin =[5072, 3742, @@ -86,16 +86,16 @@ def create(backer_number, password) 5258] # Create seed user - email = names[backer_number][1].gsub(/ /,'').downcase - user = User.create( :email => "#{email}@joindiaspora.com", :password => "#{email+pin[backer_number].to_s}", :profile => Profile.create( :first_name => names[backer_number][0], :last_name => names[backer_number][1] )) + email = backer_info[backer_number][2].gsub(/ /,'').downcase + user = User.create( :email => "#{email}@joindiaspora.com", :password => "#{email+backer_info[backer_number][0].to_s}", :profile => Profile.create( :first_name => backer_info[backer_number][1], :last_name => backer_info[backer_number][2] )) # Make friends with Diaspora Tom - Friend.create( :email => "tom@joindiaspora.com", :url => "http://tom.joindiaspora.com/", :profile => Profile.create(:first_name => "Diaspora", :last_name => "Tom")) + Friend.create( :email => "tom@joindiaspora.com", :url => "http://tom.joindiaspora.com/", :profile => Profile.create(:first_name => "Alexander", :last_name => "Hamiltom")) # Make friends (0..10).each { |n| - email = names[n][1].gsub(/ /,'').downcase - Friend.create( :email => "#{email}@joindiaspora.com", :url => "http://#{email}.joindiaspora.com/", :profile => Profile.create(:first_name => names[n][0], :last_name => names[n][1])) unless n == backer_number + email = backer_info[n][2].gsub(/ /,'').downcase + Friend.create( :email => "#{email}@joindiaspora.com", :url => "http://#{email}.joindiaspora.com/", :profile => Profile.create(:first_name => backer_info[n][1], :last_name => backer_info[n][2])) unless n == backer_number } end diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index 600d016d1..e3bcd7bd0 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -9,7 +9,7 @@ require 'config/environment' # Create seed user -user = User.create( :email => "tom@joindiaspora.com", :password => "aaaaaa", :profile => Profile.create( :first_name => "Diaspora", :last_name => "Tom" )) +user = User.create( :email => "tom@joindiaspora.com", :password => "evankorth", :profile => Profile.create( :first_name => "Alexander", :last_name => "Hamiltom" )) names = [ ["George", "Washington"], ["John", "Adams"],