diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index 5fa140597..4282b8964 100644 --- a/app/controllers/dev_utilities_controller.rb +++ b/app/controllers/dev_utilities_controller.rb @@ -37,6 +37,8 @@ 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) } @@ -54,4 +56,15 @@ def warzombie file.write(seed_num_hash.to_yaml) file.close end + + def set_profile_photo + 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 + photo = current_user.post(:photo, :album_id => album.id, + :user_file => "public/images/users/#{username}.jpg") + + current_user.update_profile(:image_url => photo.url) + end end diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index bc5039aa1..f8fe0dc97 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -19,10 +19,12 @@ def create :password => "#{username+backer_info[backer_number]['pin'].to_s}", :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'] ), + :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"), :url=> "http://#{username}.joindiaspora.com/") ) user.person.save + user.group(:name => "Presidents") end