diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index decff8514ec59edb9157e7662d0c0db841bff888..9b31103329df1eaf9c14ec513cde59a5e34ab197 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