XML reader was assuming photos were local
This commit is contained in:
parent
108ec86593
commit
7df902b9db
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue