XML reader was assuming photos were local

This commit is contained in:
ilya 2010-07-22 12:39:53 -07:00
parent 108ec86593
commit 7df902b9db

View file

@ -3,7 +3,7 @@ class Photo < Post
include MongoMapper::Document
mount_uploader :image, ImageUploader
xml_reader :remote_photo
xml_accessor :remote_photo
xml_reader :album_id
key :album_id, ObjectId
@ -23,10 +23,11 @@ class Photo < Post
end
def remote_photo
User.owner.url.chop + image.url
@remote_photo ||= User.owner.url.chop + image.url
end
def remote_photo= remote_path
@remote_photo = remote_path
image.download! remote_path
image.store!
end