Skip to content

Commit

Permalink
fix db/seeds.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianrbz committed Oct 3, 2012
1 parent a9bec8a commit ebd9f87
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions db/seeds.rb
Expand Up @@ -15,9 +15,9 @@
require Rails.root.join('spec', 'helper_methods') require Rails.root.join('spec', 'helper_methods')
include HelperMethods include HelperMethods


alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth') alice = FactoryGirl.create(:user_with_aspect, :username => "alice", :password => 'evankorth')
bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth') bob = FactoryGirl.create(:user_with_aspect, :username => "bob", :password => 'evankorth')
eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth') eve = FactoryGirl.create(:user_with_aspect, :username => "eve", :password => 'evankorth')


def url_hash(name) def url_hash(name)
image_url = "/assets/user/#{name}.jpg" image_url = "/assets/user/#{name}.jpg"
Expand All @@ -41,8 +41,7 @@ def url_hash(name)
connect_users(bob, bob.aspects.first, eve, eve.aspects.first) connect_users(bob, bob.aspects.first, eve, eve.aspects.first)
puts "done!" puts "done!"


print "making Bob an admin and beta... " print "making Bob an admin... "
Role.add_beta(bob.person)
Role.add_admin(bob.person) Role.add_admin(bob.person)
puts "done!" puts "done!"


Expand All @@ -58,9 +57,9 @@ def url_hash(name)
if(n%3==1) if(n%3==1)
post = u.post :status_message, :text => "#{u.username} - #{n} - #seeded", :to => u.aspects.first.id post = u.post :status_message, :text => "#{u.username} - #{n} - #seeded", :to => u.aspects.first.id
elsif(n%3==2) elsif(n%3==2)
post =u.post(:reshare, :root_guid => Factory(:status_message, :public => true).guid, :to => 'all') post = u.post(:reshare, :root_guid => FactoryGirl.create(:status_message, :public => true).guid, :to => 'all')
else else
post = Factory(:activity_streams_photo, :public => true, :author => u.person) post = FactoryGirl.create(:activity_streams_photo, :public => true, :author => u.person)
u.add_to_streams(post, u.aspects) u.add_to_streams(post, u.aspects)
end end


Expand All @@ -73,4 +72,4 @@ def url_hash(name)
puts " done!" puts " done!"


puts "Successfully seeded the db with users eve, bob, and alice (password: 'evankorth')" puts "Successfully seeded the db with users eve, bob, and alice (password: 'evankorth')"
puts "" puts ""

0 comments on commit ebd9f87

Please sign in to comment.