From 82d140aa804f900b994f824c36ccb30ce50bfc7b Mon Sep 17 00:00:00 2001
From: ilya <ilya@laptop.(none)>
Date: Tue, 24 Aug 2010 15:23:58 -0700
Subject: [PATCH] trying to redeploy to get photos working

---
 app/controllers/dev_utilities_controller.rb | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb
index decff8514e..9b31103329 100644
--- a/app/controllers/dev_utilities_controller.rb
+++ b/app/controllers/dev_utilities_controller.rb
@@ -63,11 +63,18 @@ def warzombie
     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
-- 
GitLab