Merge branch 'master' of github.com:diaspora/diaspora

This commit is contained in:
maxwell 2010-08-24 15:48:02 -07:00
commit ec3d902c36
3 changed files with 17 additions and 9 deletions

View file

@ -37,8 +37,6 @@ def warzombie
def zombiefriendaccept
render :nothing => true
set_profile_photo
Request.all.each{|r|
current_user.accept_and_respond(r.id, current_user.groups.first.id)
}
@ -58,16 +56,25 @@ def warzombie
end
def set_profile_photo
render :nothing => true
album = current_user.post(:album, :name => "Profile Photos")
backer_number = YAML.load_file(Rails.root.join('config','backer_number.yml'))[:seed_number].to_i
username = backer_info[backer_number]['username'].gsub(/ /,'').downcase
@fixture_name = File.dirname(__FILE__) + "../../../public/images/users/#{username}.jpg"
photo = current_user.post(:photo, :album_id => album.id,
:user_file => "")
current_user.update_profile(:image_url => photo.url)
@fixture_name = File.dirname(__FILE__) + "/../../public/images/user/#{username}.jpg"
photo = Photo.new(:person => current_user.person, :album => album)
photo.image.store! File.open(@fixture_name)
photo.save
photo.reload
current_user.raw_visible_posts << photo
current_user.save
current_user.update_profile(:image_url => photo.url(:thumb_medium))
current_user.save
end
end

View file

@ -12,6 +12,7 @@ Diaspora::Application.routes.draw do
match 'zombiefriends', :to => "dev_utilities#zombiefriends"
match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept"
match 'set_backer_number', :to => "dev_utilities#set_backer_number"
match 'set_profile_photo', :to => "dev_utilities#set_profile_photo"
#routes for devise, not really sure you will need to mess with this in the future, lets put default,
#non mutable stuff in anohter file

View file

@ -20,7 +20,7 @@ def create
:person => Person.new(
:email => "#{username}@#{username}.joindiaspora.com",
:profile => Profile.new( :first_name => backer_info[backer_number]['given_name'], :last_name => backer_info[backer_number]['family_name'],
:image_url => "http://#{username}.joindiaspora.com/images/users/#{username}.jpg"),
:image_url => "http://#{username}.joindiaspora.com/images/user/#{username}.jpg"),
:url=> "http://#{username}.joindiaspora.com/")
)
user.person.save